[英]Menu item active not activating for theme
I am trying to implement this theme for my website https://getstisla.com/demo/dashboard-ecommerce.html 我正在尝试为我的网站https://getstisla.com/demo/dashboard-ecommerce.html实施此主题
I noticed that on the site, if you click a menu item, it sets a list item active on the menu. 我注意到在网站上,如果单击菜单项,它将在菜单上设置一个活动的列表项。
However, I have tried to implement it and it but when I click on the menu item, nothing is set as active aside from the home item. 但是,我尝试实现它,但是当我单击菜单项时,除了主页项之外,没有其他项被设置为活动状态。
This is the menu 这是菜单
<div class="main-sidebar sidebar-style-2">
<aside id="sidebar-wrapper">
<div class="sidebar-brand">
@Html.ActionLink("App", "Index", "Home", new { area = "" }, new { @class = "" })
</div>
<div class="sidebar-brand sidebar-brand-sm">
@Html.ActionLink("A", "Index", "Home", new { area = "" }, new { @class = "" })
</div>
<ul class="sidebar-menu">
<li class="active"><a asp-controller="Home" asp-action="Index" class="nav-link"><i class="far fa-square"></i><span>Home Page</span></a></li>
<li class="menu-header">AM Mode</li>
<li class="nav-item dropdown">
<a href="#" class="nav-link has-dropdown"><i class="fas fa-fire"></i><span>Configuration</span></a>
<ul class="dropdown-menu">
<li><a asp-area="Configuration" asp-controller="AC" asp-action="Index" class="nav-link">A C</a></li>
<li><a asp-area="Configuration" asp-controller="B" asp-action="Index" class="nav-link">B</a></li>
</ul>
</li>
</ul>
</aside>
</div>
I have tried searching through the files for the javascript that sets the menu item active but I haven't found it so far. 我尝试在文件中搜索将菜单项设置为活动的javascript,但到目前为止尚未找到它。 I was hoping someone could take a look and see if I'm missing something.
我希望有人可以看看,看看我是否缺少什么。
The files can be downloaded from here https://cssauthor.com/bootstrap-templates/#Admin 可以从这里https://cssauthor.com/bootstrap-templates/#Admin下载文件
This is more of a ASP.NET question IMO. 这更多是一个ASP.NET问题IMO。 Possible duplication of How to add “active” class to Html.ActionLink in ASP.NET MVC
在ASP.NET MVC中如何向Html.ActionLink添加“活动”类的可能重复项
EDIT: 编辑:
The theme is hardcoding those class="active"
in static *.html
files, this theme is not a Single Page Application . 该主题是在静态
*.html
文件中对那些class="active"
进行硬编码的,该主题不是Single Page Application 。
I have tried searching through the files for the javascript that sets the menu item active
我尝试在文件中搜索将菜单项设置为有效的javascript
You won't find it, JavaScript is not setting the active class. 您找不到它,JavaScript没有设置活动类。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.