Web mouse drag effect

From , 4 Years ago, written in JavaScript, viewed 54 times.
URL https://pastebin.vip/view/d34ab169
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2.     <html xmlns="http://www.w3.org/1999/xhtml">
  3.     <head>
  4.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5.     <title>Div层的鼠标跟随拖影效果</title>
  6.     <style>
  7.     div {width:10px; height:10px; background:red; position:absolute;}
  8.     </style>
  9.     <script>
  10.     window.onload=function ()
  11.     {
  12.     var aDiv=document.getElementsByTagName('div');
  13.     var i=0;
  14.     setInterval(function(){
  15.     for(i=aDiv.length-1;i>0;i--)
  16.     {
  17.     aDiv[i].style.left=aDiv[i-1].style.left;
  18.     aDiv[i].style.top=aDiv[i-1].style.top;
  19.     }
  20.     },5);
  21.     document.onmousemove=function (ev)
  22.     {
  23.     var oEvent=ev||event;
  24.     aDiv[0].style.left=oEvent.clientX+'px';
  25.     aDiv[0].style.top=oEvent.clientY+'px';
  26.     };
  27.     };
  28.     </script>
  29.     </head>
  30.     <body>
  31.     <div></div>
  32.     <div></div>
  33.     <div></div>
  34.     <div></div>
  35.     <div></div>
  36.     <div></div>
  37.     <div></div>
  38.     <div></div>
  39.     <div></div>
  40.     <div></div>
  41.     <div></div>
  42.     <div></div>
  43.     <div></div>
  44.     <div></div>
  45.     <div></div>
  46.     <div></div>
  47.     <div></div>
  48.     <div></div>
  49.     <div></div>
  50.     <div></div>
  51.     <div></div>
  52.     <div></div>
  53.     <div></div>
  54.     <div></div>
  55.     <div></div>
  56.     <div></div>
  57.     <div></div>
  58.     <div></div>
  59.     <div></div>
  60.     <div></div>
  61.     <div></div>
  62.     <div></div>
  63.     <div></div>
  64.     <div></div>
  65.     <div></div>
  66.     <div></div>
  67.     <div></div>
  68.     <div></div>
  69.     <div></div>
  70.     <div></div>
  71.     </body>
  72.     </html>

Reply to "Web mouse drag effect"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website