使用将 clearQueue
参数设置为 true 的 stop()
与仅使用 clearqueue()
之间有什么区别,以及如果没有区别为什么两者都一样?
最佳答案
从 API 文档来看,.stop()
仅适用于动画,但是 .clearqueue()
将删除附加到的任何函数一个标准的 jquery 队列。
来自docs :
When the .clearQueue() method is called, all functions on the queue that have not been executed are removed from the queue. When used without an argument, .clearQueue() removes the remaining functions from fx, the standard effects queue. In this way it is similar to .stop(true). However, while the .stop() method is meant to be used only with animations, .clearQueue() can also be used to remove any function that has been added to a generic jQuery queue with the .queue() method.
关于Jquery:stop(true) 和clearQueue() 有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5466664/