© 本文档使用 php.cn手册 发布
从队列最前端移除一个队列函数,并执行他。
队列名,默认为fx
使用 dequeue() 终止一个自定义的队列函数
1
2
3
4
$("div").queue(function () {
$(
"div"
).queue(
function
() {
$(this).toggleClass("red");
$(this).toggleClass(
"red"
);
$(this).dequeue();
});
用dequeue来结束自定义队列函数,并让队列继续进行下去。
5
6
7
8
9
<style>
div { margin:3px; width:50px; position:absolute;
height:50px; left:10px; top:30px;
background-color:yellow; }
div.red { background-color:red; }
</style>
<button>Start</button>
<div></div>
$("button").click(function () {
"button"
).click(
$("div").animate({left:'+=200px'}, 2000);
).animate({left:
'+=200px'
}, 2000);
$("div").animate({top:'0px'}, 600);
).animate({top:
'0px'
}, 600);
$("div").animate({left:'10px', top:'30px'}, 700);
'10px'
, top:
'30px'
}, 700);