Css实现 点哪飞哪 特效 简单版

div{
            position:absolute;  //使DIV块脱离文档流 
transition:left 1s linear,top 1s linear; }
var target=document.getElementById("div");
          target.style.left="0px";
          target.style.top="0px";
          document.onmousedown = function(evt){     //鼠标按下事件
              target.style.left= evt.pageX+"px";
              target.style.top= evt.pageY+"px";
          }

 

posted @ 2019-04-04 14:06  Zb·  阅读(195)  评论(0)    收藏  举报