I have a ul which functions as the main navigation. I have one li inside that ul which, when hovered on, slides down a hidden div with a bunch of information. This div appears right below the main nav. I would like to have the div hide itself if the user moves their mouse vertically, outside the main nav. I need it to stay if they mover their mouse over the div so they can click links located there.
Here's some of the code:
<ul>
<li> <a href="#">item one </a></li>
<li id="locations"> <a href="#">item two </a> </li>
<li> <a href="#">item three </a> </li>
</ul>
<div id="superNav"> div content is here </div>
Here is the current jQuery:
$('li#locations a').hover(function(){
$('#locationsSuperNav').slideDown();
});
$('#locationsSuperNav').mouseleave(function(){
$(this).slideUp();
});
Is there any way to use a y coordinate to also trigger the mouseleave event?
Thanks in advance for any help.