Search code examples
jqueryjquery-animatedestroy

jQuery - destroy animation


How to destroy created animation on same element?

For example: I have animation

$('#sortable').animate({
    paddingTop: 85
}, 100);

And on same action I want to destroy it, because I done need it anymore. Something like:

$('#sortable').animate('destroy');

But it doesn't work.


Solution

  • just use stop()

    $('#sortable').stop(true);// first argument removes all animations in the queue