Reputation: 971
So for a nav, I am showing a "secondary" div when a certain "nav1" LI is hovered. I would like the div to be hidden when the focus is no longer on the #nav1 LI or the secondary div. jsFiddle Demo
Usually I would just place the "secondary" div inside the #nav1 li. But I can't do so for some logistical reasons. So I am basically trying to hide the secondary div on hover out only when the mouse is not on top of either #secondary or #nav1
Upvotes: 1
Views: 151
Reputation: 13527
Maybe set a timeout setTimeout(function, delay)
on hover out callback of first element, and set a flag true
on hover of second element, and set it back to false
on hover out. When timeout is done, check if flag is true
, then user is hovering over second element.
Upvotes: 0
Reputation: 208032
Have you tried this:
$("#secondary").mouseleave(function() {
$(this).slideUp(500);
});
Upvotes: 1