首页 > Web开发 > 详细

jQuery清除、停止队列中剩下(未执行的函数)

时间:2017-05-11 21:21:24      阅读:252      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery清除、停止队列中剩下(未执行的函数)</title>
<script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
//clearQueue() 清除、停止队列中剩下(未执行的函数)
$(document).ready(function(){
$("#start").click(function(){ //队列动画
$("div").animate({height:300},1500);
$("div").animate({width:300},1500);
$("div").animate({height:100},1500);
$("div").animate({width:100},1500);
});
$("#stop").click(function(){
$("div").clearQueue();
});
});
</script>
</head>
<body>

<button id="start">开始动画</button>
<button id="stop">停止动画</button>
<br><br>
<div style="background:lightpink;height:100px;width:100px;">
</div>

</body>
</html>

jQuery清除、停止队列中剩下(未执行的函数)

原文:http://www.cnblogs.com/YoogaChan/p/6842686.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!