Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript get cursor position without event

var Cursor_X;
var Cursor_Y;
document.addEventListener('mousemove', onMouseUpdate, false);
document.addEventListener('mouseenter', onMouseUpdate, false);
function onMouseUpdate(e){
    Cursor_X = e.pageX;
    Cursor_Y = e.pageY;
}
 
PREVIOUS NEXT
Tagged: #javascript #cursor #position #event
ADD COMMENT
Topic
Name
6+7 =