I'm having trouble getting the Y mouse coordinates.
function mouseDistance() {
document.onmousemove = handleMouseMove;
function handleMouseMove(e) {
document.getElementById("tester").innerHTML = e.screenX + " " + e.screenY;
}
}
function mainLoop() {
mouseDistance();
requestAnimationFrame(mainLoop);
}
requestAnimationFrame(mainLoop);
e.screenX
is working properly, but e.screenY
isn't. In the html body, at the top most edge it doesn't get lower than 95px (shouldn't it be 0?).
I do have a 'CSS reset'.
Example: The mouse at the top left corner will be at x: 0; y: 95;