I have a simple drop-down menu that is controlled using the following script:
$(document).ready(function () {
$('img.menu_class').hover(function () {
$('.the_menu').slideToggle('medium');
});
});
I can’t work out how to continue to display the div that is revealed, i.e. “.the_menu”, when the mouse leaves the ‘img.menu_class’ div but stays in the “.the_menu” div. It needs to be preserved whilst the mouse is in either of these divs.
You can see the menu in its current state here. Just hover on the main nav bar (it’s just an image at the moment) to see the drop-down menu.
Could someone help with this?
Thanks,
Nick
Instead of
hover()you can switch tomouseenter()andmouseleave()and change the markup a bit.Example:
HTML:
JS:
HERE is the working code.