I am trying to create a dynamic side menu that displays different links depending on which link is hovered over in the top navigation bar. Here is what I have so far:
HTML:
<ul class="nav navbar-nav">
<li class="nav"><a class="toggle" href="#">LINK 1</a></li>
<li class="nav"><a class="toggle" href="#">LINK 2</a></li>
<li class="nav"><a class="toggle" href="#">LINK 3</a></li>
<li class="nav"><a class="toggle" href="#">LINK 4</a></li>
<li class="nav"><a class="toggle" href="#">LINK 5</a></li>
<li class="nav"><a class="toggle" href="#">LINK 6</a></li>
</ul>
<div class="sideMenu">
<div id="sideMenuLinks">
<ul id="menuContent" class="menuContent collapse out">
<li><a href="#">SM LINK 1</a></li>
<li><a href="#">SM LINK 2</a></li>
<li><a href="#">SM LINK 3</a></li>
<li><a href="#">SM LINK 4</a></li>
<li><a href="#">SM LINK 5</a></li>
<li><a href="#">SM LINK 6</a></li>
</ul>
</div>
</div>
jQuery:
$(document).ready(function() {
$('.toggle').hover(function () {
$('#sideMenuLinks').show('slow');
});
});
Although this code successfully displays the side menu when a link is hovered over, I would like the side menu to dynamically change based on the specific link that is hovered over. For example, if "LINK 2" is hovered over, I want the side menu to display a different set of links. Is there a way to achieve this functionality?
Thank you!