JQuery beautifully queues up successive animations applied to an HTML object, and that is great. But sometimes this can be an irritant, say like when you have mouseover and mouseout effects and if the animations queue up when user quickly hovers the mouse over and out on the HTML object.

So is there a way to cancel previous JQuery animations on a HTML div before starting a new one?

Well, yes, just call the stop method on the object before calling the animate method on it as shown in the example below.

$("#animationDiv").stop().animate({opacity:0},500);

SocialTwist Tell-a-Friend

Knowledge is Power. You may also like:
Subscribe to HitXP: Be the first to read.
Articles Indian Music Notes Free Software Downloads Kannada