这么简单的东西,一堆收费的,还特么有很多都是直接cv别人免费的拿来收费,这么缺?
<style> div{ width: 100px; height: 100px; border: 1px solid black;
border-radius: 50%; text-align: center; line-height: 70px; cursor: pointer; }
</style> <body> <div id="qiudiv" onclick="moo()" click="" style="position:
absolute;"> <p id="mo">点我移动</p> </div> </body> <script> //接收 var borName =
document.getElementById("mo"); //定义初始div位置 qiuX=0; var i = 0; var count = 0;
function moo(){ count++; if(count % 2 != 0){ borName.innerHTML ="停止移动"; i =
setInterval(function(){ qiuX+=1; //修改div的left top qiudiv.style.left=qiuX+"px";
}, 10); }else{ clearInterval(i); borName.innerHTML = "点我移动"; } } </script>