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


<!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>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM