<body>
<input type="button" name="" id="" value="停止" />
<div class="box"></div>
</body>
<script src="js/js/jquery-1.12.4.min.js"></script>
<script src="js/js/jquery.easing.1.3.js"></script>
<script>
$($('.box')[0]).on('mouseover',function(){
$(this).animate({width:600,height:600},5000,function(){
$(this).animate({width:100,height:100},5000);
});
});
$('input').on('click',function(){
//效果等同于$($('.box')[0]).stop(false,false);
//$($('.box')[0]).stop();
//正在播放的动画立即停止,播放下一个动画
//$($('.box')[0]).stop(false,false);
//清空了后续动画,不会再做播放
//$($('.box')[0]).stop(true,false);
//立即执行完成当前动画(变成最终值),再继续执行后面的动画
//$($('.box')[0]).stop(false,true);
//立即变成最终状态,没有后续的动画执行
//$($('.box')[0]).stop(true,true);
});
</script>
jq stop(停止动画)
最新推荐文章于 2021-05-21 11:00:47 发布