Mouse tracking

It should be usually easy, I want to track mouse movements. I am able to capture the XY coordinates.

However, as far as I know, this will depend on the size of the browser, right?

If so, can anyone recommend other things to keep track of so that my results are accurate?

Ps I am using the following jQuery example

$("html").mousemove(function(e){
var pageCoords = "( " + e.pageX + ", " + e.pageY + " )";
var clientCoords = "( " + e.clientX + ", " + e.clientY + " )";
$("span:first").text("( e.pageX, e.pageY ) - " + pageCoords);
$("span:last").text("( e.clientX, e.clientY ) - " + clientCoords);
});
+3
source share
1 answer

The coordinates do not depend on the size of the browser.

Hope this helps. Greetings

PS: Use $(window).mousemoveor $(document).mousemoveinstead $("html").mousemove, it's better.

+1
source

All Articles