Similar to: How to Display Selected Item in Bootstrap Button Dropdown Title
I have a two-level bootstrap menu. I would like when a item is selected and navigated to, that that the drop down list from where the item is, to be always be displayed. Here is my cut down version of the code:
<ul class="menu-system">
<li class="active">
<a href="#">Location</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle menu-item" data-toggle="dropdown"> Top level Option 1</a>
<ul class="dropdown-menu">
<li><a href="#"> Option 1</a></li>
<li><a href="#"> Option 2</a></li>
<li><a href="#"> Option 3</a></li>
<li><a href="#"> Option 4</a></li>
</ul>
</li>
Example: When the Top level Option 1> Option 1 page is active I would like to show the drop down menu. What it does at the moment is only display the top level menu. Since its a bootstrap drop down it will shown by default which is the correct way a drop down menu should work. Not sure if I can make it be shown dynamically. This should always been shown regardless if a user clicks off it or anything else on that page.
I am working in an ASP.NET application. I'm not sure that is has to do with the active tag, or if I have to write some javascript/jquery code to get the current page and display the appropriate drop down menu.
Any help greatly appreciated.
JSFiddle: jsfiddle.net/yZ8C6