I am having a piece of code which checks if the mouse moves out of the browser window from the top of the browser.
For that i am using addEventListener function with mouseout event.
function addEvent(obj, evt, fn) {
obj.addEventListener(evt, fn, false);
}
}
addEvent(window, "mouseout", function(e) {
if (e.clientY > 0) {
return;
}
alert('window out from top');
}
});
This works as expected on Chrome, Firefox etc. But for IE, Edge e.clientY never becomes less than 0 if I move the cursor out of the window very fast. It works fine if i move the cursor really slow.