abstract:<!DOCTYPE html><html><head><meta charset="UTF-8"><title>jQuery 自定義動(dòng)畫(huà)-停止動(dòng)畫(huà)</title><script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"&g
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>jQuery 自定義動(dòng)畫(huà)-停止動(dòng)畫(huà)</title>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
<style>
button{font-size: 38px;background: #999;padding:10px;border-color: #000;}
div{background: blue;width: 100px;height: 100px;margin-top: 20px;position: absolute;}
</style>
</head>
<body>
<script type="text/javascript">
$(document).ready(function(){
$('#start').click(function(){
$('.box1').animate({left:'+500px'},1000)
$('.box1').animate({fontSize:'30px'},500)
$('.box1').animate({bottom:'+300px'},1000)
$('.box1').animate({left:'+10px'},1000)
$('.box1').animate({top:'+80px'},1000)
})
$('#stop').click(function(){
$('.box1').stop(true)
})
})
</script>
<button id="start">啟動(dòng)</button>
<button id="stop">停止</button>
<div>this is a box</div>
</body>
</html>
Correcting teacher:滅絕師太Correction time:2019-03-05 13:29:01
Teacher's summary:停止動(dòng)畫(huà)一般都結(jié)合在jq動(dòng)畫(huà)效果上,帶案例測(cè)試更明顯!