annimate只能执行一次 财富值58

2016-11-05 18:08发布

写了个div代码,发现只能执行一次,搜网页,发现可以多次执行,到底要怎么才能多次执行,按钮状态可以多次,但是div不行

<script> $(document).ready(function(e) {              var w=Math.floor(Math.random()*document.documentElement.clientWidth);     var h=Math.floor(Math.random()*document.documentElement.clientHeight);     $("div").offset();          $("#btn").mouseenter(function(e){             $("div").animate({             "width":"100px",             "top":h,             "left":w             },2000);          });                  }); </script> <body> <div style="position:relative;background-color:red ;width:50px;height:50px" ><input type="button" style="float:left "   value="你点不到我"   id="btn"   /></div> </body>
付费偷看设置
发送
1条回答

$("#btn").mouseenter(function(e){
var w=Math.floor(Math.random()*document.documentElement.clientWidth);