Created
November 29, 2012 00:29
-
-
Save baxang/4165837 to your computer and use it in GitHub Desktop.
Canceling current animation when the mouse pointer hovers on/out quickly.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#i-am-an .box').hover( | |
function(e) { | |
var t = $(this).find('.drawer'); | |
if (t.is(':animated')) { | |
t.stop(true, false); | |
} | |
t.delay(100).animate({top:'0px'}, 400); | |
}, | |
function(e) { | |
var t = $(this).find('.drawer'); | |
if (t.is(':animated')) { | |
t.stop(true, false); | |
} | |
t.animate({top:'300px'}, 400); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment