jquery中的’fx’队列如何自动启动?

我已经在jQuery队列上阅读了很多答案和博客文章……特别是这个特定的答案有很多帮助 – https://stackoverflow.com/a/3314877/1315811 。 但是,jquery.com上的标准文档和上面的答案让我看看jquery代码http://code.jquery.com/jquery-1.7.2.js

我无法理解 – 从代码中 – ‘fx’(默认)队列如何自动启动。 特别是队列被清空后。

例如,在自定义队列上,当您手动启动队列,并且队列用完要调用的函数时,对队列的任何引用都不再无效,所以我希望jquery代码中的某个地方试图找出状态队列如果是空的自动启动它? 代码有点展示我遇到的,如果我只是缺少一段代码(我在上面的代码中看到行:2060-2160)请告诉我。

> var aq = $({}); > aq.queue("mp").length 0 > n1 = aq.queue("mp") [] > n1.length 0 > aq.queue("mp", function (next) { setTimeout(next, 5000); }) [Object] > aq.queue("mp", function (next) { setTimeout(next, 5000); }) [Object] > aq.queue("mp", function (next) { setTimeout(next, 5000); }) [Object] > n1.length 0 > aq.queue("mp").length 3 > n1 = aq.queue("mp"); // reset n1 to the "new" queue... > n1.length 3 

此外,如果任何部分不清楚,请告诉我,我会相应更新。

queue代码中的这段代码处理自动启动:

 if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } 

如果正在排队的队列是fx且队列尚未进行,则调用dequeue