Reputation: 7599
when applying animation to an element - eg. div.animate() - how can i unbind that animation from single elements?
i've tried div.unbind() and div.unbind("animate") but didnt work..
thanks
Upvotes: 0
Views: 4317
Reputation: 869
I think you need this:
$('#div').stop(); // this stop the currently-running animation
The animation is not bind to an element, it is just an effect => you can't unbind
Upvotes: 3
Reputation: 50019
If you just want to stop the animation on the selected element instead of completely switching animations for all elements, simply use div.stop() or div.clearQueue()
http://api.jquery.com/clearQueue/
if you actually use div.stop(true), it will actually call clearQueue as well.
Upvotes: 3