Created
June 26, 2014 02:19
-
-
Save didasy/ec2713b285335b54425d to your computer and use it in GitHub Desktop.
To track a mouse every x seconds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mouse = { x : 0, y : 0 }; | |
document.addEventListener('mousemove', function (e) { | |
mouse.x = e.clientX || e.pageX; | |
mouse.y = e.clientY || e.pageY; | |
}) | |
var track = function () { | |
console.log(document.elementFromPoint(mouse.x, mouse.y)); | |
setTimeout(track, 3000); | |
} | |
track(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment