jquery - Mousenter cancel mouseleave on cursor re-enter -


in example if move mouse in, out, in, out mouseleave event still fire twice

http://jsfiddle.net/4bslm/1/

how can make fadeout event stop firing if cursor moved in?

$(document).on("mouseenter","div",function() { $(this).find("span").fadein(400);}).on("mouseleave","div",function() {$(this).find("span").delay(700).fadeout(400);}); 

(note .on required)

use stop() method stop playing animation.

jsfiddle

$(document).on("mouseenter", "div", function () {     $(this).find("span").stop().fadein(400); }).on("mouseleave", "div", function () {     $(this).find("span").stop().delay(700).fadeout(400); }); 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

node.js - Node - Passport Auth - Authed Post Route hangs on form submission -

Does Firefox offer AppleScript support to get URL of windows? -