Answers for "js mousemove"

8

Javascript track mouse pointer

var pointerX = -1;
var pointerY = -1;
document.onmousemove = function(event) {
	pointerX = event.pageX;
	pointerY = event.pageY;
}
setInterval(pointerCheck, 1000);
function pointerCheck() {
	console.log('Cursor at: '+pointerX+', '+pointerY);
}
Posted by: Guest on November-03-2020
-1

js mouse move activate

$('body').bind('mousemove',function(e){   
    // Mousemove event triggered!
});
$(function(){
    $('body').trigger('mousemove');
});
Posted by: Guest on February-23-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language