javascript - jQuery - Only Call The Hover Out Function if Cursor Isn't Entering Any Siblings -
i'm trying create effect similar navigation on site: http://rogwai.com/. i'm close can in jsfiddle.
it's working fine if hover 1 li @ time (i.e. bottom). if however, slide horizontally through each list item 'follower' returns active position or slides of end after each item that's hovered over. instead should follow mouse.
looking @ code executed on hover out understandable. can't head around how make return active position or slide off end when mouse leaves menu.
hopefully makes sense - should see problem straight away jsfiddle.
thanks in advance.
what can add mouseenter
part li
have it, put mouseleave
part on entire ul
. way, leave fire when mouse out of entire ul
.
$('nav.block-system-main-menu ul li:not(.follower)').mouseenter(function() { followermove($(this)); }); $('nav.block-system-main-menu ul').mouseleave(function(){ followermove($active); });
note, if using jquery 1.2.6 (quite old), need modify bit mouseenter
, mouseleave
not exist.
Comments
Post a Comment