Ackbar Ackbar - 1 year ago 70
CSS Question

Add css class in next page after follow link ( razor)

I have the drop-down menu on jQuery. I need activate menu item and submenu item in next page after follow link.

<div class="menu__item">Menu Item 1</div>
<div class="menu__item__submenu">
@Html.ActionLink("Submenu item 1", ..., new { @class = "submenu__item" })


<div class="menu__item menu__item-active">Menu Item 1</div>
<div class="menu__item__submenu submenu-active-js">
@Html.ActionLink("Submenu item 1", ..., new { @class = "submenu__item submenu__item-active" })

How i can make it?

Answer Source

It is just example not perfect code. you need to customization as per your code.


switch (window.location.pathname) {
    case '/technology':
    case '/something':
    case '/somestuff':
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download