<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>时代Java与您共同学习(NowJava.com)</title>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
var div=$("div");
$("#start").click(function(){
div.animate({height:300},"slow");
div.animate({width:300},"slow");
div.queue(function () {
div.css("background-color","red");
div.dequeue();
});
div.animate({height:100},"slow");
div.animate({width:100},"slow");
});
$("#stop").click(function(){
div.clearQueue();
});
});
</script>
</head>
<body>
<p>queue() 方法显示被选元素上要执行的函数队列。</p>
<p>dequeue() 从队列移除下一个函数,然后执行函数。</p>
<p>clearQueue() 方法从尚未运行的队列中移除所有项目。<p>
<p>
<button id="start">开始动画</button>
/**代码未完, 请加载全部代码(NowJava.com).**/
本文系作者在时代Java发表,未经许可,不得转载。如有侵权,请联系nowjava@qq.com删除。