返回jQuery ......登陆

jQuery 自定义动画-停止动画

Binbin(斌斌老师)2019-03-05 10:02:38257

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>jQuery 自定义动画-停止动画</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">启动</button>

<button id="stop">停止</button>

<div>this is a box</div>

</body>

</html>


最新手记推荐

• 用composer安装thinkphp框架的步骤• 省市区接口说明• 用thinkphp,后台新增栏目• 管理员添加编辑删除• 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消回复发送