<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>自定动画</title>
<script type="text/javascript" src="jquery-3.3.1.min.js"></script>
<style type="text/css">
.box{width: 200px;height: 200px;background: red;position: absolute;}
</style>
</head>
<body>
<script type="text/javascript">
$(document).ready(function(){
$('.bt1').click(function(){
$('.box').animate({left:'+200px'},3000)
$('.box').animate({fontSize:'40px'},500)
})
$('.bt2').click(function(){
$('.box').stop(true)
})
})
</script>
<button class="bt1">右移</button>
<button class="bt2">停止</button>
<div class="box">早安~~~</div>
</body>
</html>
总结:stop()内部参数的作用:stop(true)停止所有动画,stop(true,true)直接结束动画跳到最后。