Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var clickIndicator = document.createElement("div");
- document.body.appendChild(clickIndicator);
- clickIndicator.style.position = "fixed";
- clickIndicator.style.width = "12px";
- clickIndicator.style.height = "12px";
- clickIndicator.style.display = "block";
- clickIndicator.style.background = "red";
- clickIndicator.style.left = "0";
- clickIndicator.style.top = "0";
- function spookyClick() {
- var x = 32 + Math.round(Math.random() * 128);
- var y = 32 + Math.round(Math.random() * 64);
- var ev = document.createEvent("MouseEvent");
- var el = document.elementFromPoint(x,y);
- ev.initMouseEvent("click", true, true, window, null, x, y, 0, 0, false, false, false, false, 0, null);
- el.dispatchEvent(ev);
- clickIndicator.style.left = x;
- clickIndicator.style.top = y;
- }
- window.setInterval(spookyClick, 500);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement