I'm having a jquery issue with a small menu I have. I have a list of menu items. When I hover over one of the list items, I would like to show the content from a list of divs that shares the same index as the list item. This needs to be dynamic do allow any number of menu items and content items.
$(document).ready(function() {
$("#leftnav li").each(function(){
$(this).mouseover(function() {
//SHOW div that shares same index as this li
});
$(this).mouseout(function() {
//HIDE div that shares same index as this li
});
});
});
<ul id="leftnav">
<li>Link 1</li>
<li>Link 2</li>
</ul>
<div id="content">
<div>Content 1</div>
<div>Content 2</div>
</div>