I set up a typical navbar, and when you hover over one element (“Our Teams”) a dropdown appears (using the jquery below):
$("li#menu-item-20").hover(function(){
$("#dropdown").stop().fadeIn(500);
}, function(){
$("#dropdown").stop().fadeOut(500);
});
When you then hover over the dropdown (#dropdown) the dropdown fades back out (because I hovered off the menu item) I need the jquery to work so it will allow for hovering over the dropdown, and will fade out after you hover off the dropdown AND the nav menu.
Any ideas? You can see a working example at http://pixelcakecreative.com/cimlife/
If you bind the
mouseleaveevent to the#dropdownelement the dropdown will remain until the user mouse-outs the dropdown:Here is a jsfiddle of the above solution: http://jsfiddle.net/jasper/kED9T/2/