jquery - 队列名称是什么?

标签 jquery deque

在此代码中:

$('.slide').delay(2000).fadeOut(500);

这是如何使用 dequeue() 函数吗?因为它在 jQuery 网站中显示 dequeue([queueName])。因为我想使 fadeOut() 出列; fadeOut 是queueName 吗?

这就是 dequeue() 函数的使用方法吗?

$('.slide').dequeue('fadeOut');

谢谢。

最佳答案

不,不是。有一个默认队列,所有效果方法都添加到其中,称为fx。请参阅queue文档:

Every element can have one to many queues of functions attached to it by jQuery. In most applications, only one queue (called fx) is used. Queues allow a sequence of actions to be called on an element asynchronously, without halting program execution.

您可以使用其他名称创建其他队列。

传递给dequeue的参数是队列的名称,而不是函数的名称。因此,您可能需要 $('.slide').dequeue('fx');,它与 $('.slide').dequeue(); 相同>.

关于jquery - 队列名称是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4862738/

相关文章:

python - 将 python 双端队列分配给列表

python - open(logPath, 'r') as fh : 语法错误

用于双端队列索引的 C++ swap()

c++ - 为什么 push_back 或 push_front 使双端队列的迭代器无效?

javascript - 在 IE 中使用 iframe 时,信号器脚本中的访问被拒绝错误

javascript - jQuery - 在代码行之前查找特定元素

JQuery 事件处理程序有或没有?

java - 无法解决 Java 双端队列迭代错误

javascript - fullcalendar.io - 在内存中保存事件

php - 链接各种浏览器的单独/条件/唯一样式表