<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
<script>
$(function(){
$('#start').click(function(){
$('div').animate({left:'500px'},3000);
$('div').animate({fontSize:'3em'},3000);
});
$('#stop').click(function(){
$('div').stop();
});
$('#stop2').click(function(){
$('div').stop(true);
});
$('#stop3').click(function(){
$('div').stop(true,true);
});
});
</script>
</head>
<body>
<button id="start">开始</button>
<button id="stop">停止</button>
<button id="stop2">停止所有</button>
<button id="stop3">停止动画,但完成动作</button>
<p>点击 "开始" 按钮开始动画。</p>
<p>点击 "停止" 按钮停止当前激活的动画,但之后我们能再动画队列中再次激活。</p>
<p>点击 "停止所有" 按钮停止当前动画,并清除动画队列,所以元素的所有动画都会停止。</p>
<p>点击 "停止动画,但完成动作" 快速完成动作,并停止它。</p>
<div style="width: 300px;height: 200px;position: absolute;background: red;">hello</div>
</body>
</html>
python前端基础--动画停止
最新推荐文章于 2023-11-06 11:01:32 发布