2012-05-31 59 views
1

如何銷燬相同元素上創建的動畫?jQuery - 銷燬動畫

例如: 我有動畫

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

而且在相同的動作我要摧毀它,因爲我做了需要它了。 類似於:

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

但它不起作用。

+3

你是什麼意思的破壞?停止 ? – ManseUK

+0

試試這個? jQuery.fx.off = true; – Jim

+0

我想答案已經在計算器上 見 http://stackoverflow.com/questions/5077933/jquery-stop-animation-from-element 和 http://stackoverflow.com/問題/ 7378405/jQuery的綁定,解除綁定,動畫 –

回答

3

只使用stop()

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