优艾设计网

annimate只能执行一次?

优艾设计网 https://www.uibq.com 2023-04-15 14:43 出处:网络 作者:PS抠图
写了个div代码,发现只能执行一次,搜网页,发现可以多次执行,到底要怎么才能多次执行,按钮状态可以多次,但是div不行 <script> $(document).ready(function(e) {var w=Math.floor(Math.random()*document.d

写了个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&优艾设计网_Photoshop问答gt; <body> <div style="position:relative;background-color:red ;width:50px;height:50px" ><input type="button" style="float:left " value="你点不到我" id="btn" /></div> </body>


密码要好记 优艾设计网_Photoshop论坛 2022-06-04 12:44

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


0

精彩评论

暂无评论...
验证码 换一张
取 消