返回jquery动......登陆

jquery动画停止

帅帅 OMG2018-12-31 22:58:58229
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>jquery动画停止</title>
<style>
.main{width: 700px;margin:0 auto;
}
.content{width: 700px;height: 700px;border:1px solid gray;}
.box{ position: relative;width: 200px;height: 200px;background: red }
</style>
    <script type='text/javascript' src="jquery-3.3.1.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
     $('.right').click(function(){
     $('.box').animate({left:'500px'},3000)
     })
     $('.bottom').click(function(){
     $('.box').animate({top:'500px'},3000)
     })
     $('.left').click(function(){
     $('.box').animate({left:'0px'},3000)
     })
     $('.up').click(function(){
     $('.box').animate({top:'0px'},3000)
     })
     $('.box').mouseover(function(){
     $('.box').stop(true)
     })
     $('.box').mouseout(function(){
     $('.box').show(true)
     })
    })
    </script>
</head>
<body>
<div>
<button>右移</button>
<button>下移</button>
<button>左移</button>
<button>上移</button>
<p>div移动时 鼠标移上div,动画停止</p>

<div>
<div></div>
</div>
</div>
</body>
</html>


最新手记推荐

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

全部回复(0)我要回复

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