chuck.js/snippets/canvas-mouseposition.js
2014-01-12 16:59:16 +01:00

6 lines
No EOL
156 B
JavaScript
Executable file

var myCanvas = null;
myCanvas = document.getElementsByTagName('canvas')[0];
myCanvas.onmousemove = function(e){
console.log(e.clientX - this.offsetLeft)
}