从队列最前端移除一个队列函数,并执行他。
返回值
jQuery
参数
name (String) :队列名,默认为fx
示例
用dequeue来结束自定义队列函数,并让队列继续进行下去。
HTML 代码:[code]
div { margin:3px; width:50px; position:absolute;
height:50px; left:10px; top:30px;
background-color:yellow; }
div.red { background-color:red; }
Start
[/code]jQuery 代码:[code] $("button").click(function () { $("div").animate({left:'+=200px'}, 2000); $("div").animate({top:'0px'}, 600); $("div").queue(function () { $(this).toggleClass("red"); $(this).dequeue(); }); $("div").animate({left:'10px', top:'30px'}, 700); }); [/code]