HTML:
<ul class="dropdown">
<li><a href="#">Item 1</a></li>
<li>
<a href="#">Item 2</a>
<div class="submenu">something</div>
</li>
</ul>
jQuery:
$j("ul.dropdown li").hover(function () {
$j(this).addClass("hover");
$j('div.submenu', this).css('visibility', 'visible').hover(function () {
$j(this).prev('a').addClass('hover');
}, function () {
$j(this).prev('a').removeClass('hover');
});
}, function () {
$j(this).removeClass("hover");
$j('div.submenu', this).css('visibility', 'hidden');
});
... the menu works fine, but the navigation link (that opens the dropdown) should stay highlighted when on the dropped-down menu. How do I maintain hover state on both the link and the submenu when they're open?
Thanks!