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