Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     var clickIndicator = document.createElement("div");
  2.     document.body.appendChild(clickIndicator);
  3.     clickIndicator.style.position = "fixed";
  4.     clickIndicator.style.width = "12px";
  5.     clickIndicator.style.height = "12px";
  6.     clickIndicator.style.display = "block";
  7.     clickIndicator.style.background = "red";
  8.     clickIndicator.style.left = "0";
  9.     clickIndicator.style.top = "0";
  10.     function spookyClick() {
  11.         var x = 32 + Math.round(Math.random() * 128);
  12.         var y = 32 + Math.round(Math.random() * 64);
  13.         var ev = document.createEvent("MouseEvent");
  14.         var el = document.elementFromPoint(x,y);
  15.         ev.initMouseEvent("click", true, true, window, null, x, y, 0, 0, false, false, false, false, 0, null);
  16.         el.dispatchEvent(ev);
  17.         clickIndicator.style.left = x;
  18.         clickIndicator.style.top = y;
  19.     }
  20.     window.setInterval(spookyClick, 500);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement