将动画应用于元素时 - 例如。div.animate() - 我如何从单个元素中取消绑定该动画?
我试过 div.unbind() 和 div.unbind("animate") 但没用..
谢谢
将动画应用于元素时 - 例如。div.animate() - 我如何从单个元素中取消绑定该动画?
我试过 div.unbind() 和 div.unbind("animate") 但没用..
谢谢
如果您只想停止所选元素上的动画而不是完全切换所有元素的动画,只需使用 div.stop() 或 div.clearQueue()
http://api.jquery.com/clearQueue/
如果您实际使用 div.stop(true),它实际上也会调用 clearQueue。
我认为你需要这个:
$('#div').stop(); // this stop the currently-running animation
动画没有绑定到元素,它只是一个效果 => 你不能取消绑定
对于单个元素:
$(selector).clearQueue().stop();