2

This is a very specific issue as it only applies to IE11 under Windows 8.1. You can easily track the mouse position using following code snippet:

document.addEventListener('mouseout', function(e) {
    console.log(e.clientY);
});

If you paste this in the console of any browser, you will see that it outputs a negative value whenever you move your mouse to the address bar / top of your screen.

But in IE11 under Windows 8.1 the event is never triggered when clientY is supposedly holding negative values.

How can I detect a user moving out of the document when I cannot detect negative values?

Amberlamps
  • 39,180
  • 5
  • 43
  • 53
  • 1
    Can you provide us a [jsfiddle](http://jsfiddle.net/) that demonstrates the issue? – Mgetz Mar 05 '14 at 16:18
  • @Mgetz: Sure, but it is basically the code that I already provided. Move your mouse out of the "Result" box. http://jsfiddle.net/aUPjz/ – Amberlamps Mar 05 '14 at 16:21
  • This only applies for IE11 in Windows 8.1. Any other combination will most likey see negative values in the console. – Amberlamps Mar 05 '14 at 16:22
  • Which IE11? Metro or Desktop? – Mgetz Mar 05 '14 at 16:24
  • May I ask - why do you need to know the position when you mouse out of the document? – Ian Mar 05 '14 at 16:24
  • Desktop. But I just realized that it works with the jsFiddle. Probably because there is still a document above it. Please copy and paste that code to your console of this page for example and try to get a negative value. – Amberlamps Mar 05 '14 at 16:25
  • 1
    @Amberlamps You can look at the jsFiddle fully by going to http://jsfiddle.net/aUPjz/show/ – Ian Mar 05 '14 at 16:26
  • @Ian: Thanks. Did not know that. If you use Ian´s link, you will see the problem. – Amberlamps Mar 05 '14 at 16:27
  • 1
    @Amberlamps IE11 is compliant with [DOM3](http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseout) it only requires that it gives coordinates in the viewport of the window, if the mouse is not in the window then the behavior would be undefined. – Mgetz Mar 05 '14 at 16:32
  • @Mgetz: THanks, but it is working with IE11 under Windows 7 though. – Amberlamps Mar 05 '14 at 16:38
  • @Amberlamps I would not depend on anything that's not in the standard. You can report this on [Connect](http://connect.microsoft.com) if you think it is a bug. But don't be surprised if the IE team bounce it back. – Mgetz Mar 05 '14 at 16:40
  • possible duplicate of [32 bits IE Toolbar not working in Win 8.1 64 bits RTM/IE11](http://stackoverflow.com/questions/18850655/32-bits-ie-toolbar-not-working-in-win-8-1-64-bits-rtm-ie11) – Paul Sweatte Jan 07 '15 at 22:13

0 Answers0