Created
March 22, 2018 14:20
-
-
Save anton-chernianu/e6e25ccc07de33eef19ad88a7adfd926 to your computer and use it in GitHub Desktop.
Javascript Check Mouse Position
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
window.onmousemove = logMouseMove; | |
function logMouseMove(event) { | |
let e = event || window.event; | |
mousePos = { x: e.clientX, y: e.clientY }; | |
console.log(mousePos); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment