Skip to content

Instantly share code, notes, and snippets.

@baxang
Created November 29, 2012 00:29
Show Gist options
  • Save baxang/4165837 to your computer and use it in GitHub Desktop.
Save baxang/4165837 to your computer and use it in GitHub Desktop.
Canceling current animation when the mouse pointer hovers on/out quickly.
$('#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