javascript - jQuery: don't waiting till animation finish on multi clicks -
i need make on click event don't wait till current animation finish , execute last click.
example code http://jsfiddle.net/djpnu/
** try click 7 10 times fast , see animation going 1 after 1 slowly
$("button").click(function(){ $("div").animate({ height:'+=20px', width:'+=20px' }); });
thank you
you'll want use stop
stops previous animation.
$("button").click(function(){ $("div").stop(true).animate({ height:'+=20px', width:'+=20px' }); });
Comments
Post a Comment