Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ol> <li><blockquote> <p>Why can't the browser can't reliably capture the mouseout event? If I can reliably tell when the mouse has left the div using the above workaround, why can't the browser do it?</p> </blockquote> <p>I think you answered this one yourself when you said:</p> <blockquote> <p>Compared to letting the browser do all this natively, performing calculations on every pixel move is a bit of a performance hit.</p> </blockquote> <p>The browser does not interpolate between the frames, thus, as you stated it would demand a lot more resources and memory, which may be why it isn't "fixed".</p></li> <li><blockquote> <p>If some pixel movements are missed just as the mouse crosses the boundary of the div, why does it follow that the mouseout event should also be skipped? When the browser finally starts registering the mouse's position again (after a sudden fast movement), even if the mouse is now miles outside the box, the point is that it used to be in the box and no longer is. So why doesn't it then fire the mouseout event then?</p> </blockquote> <p>I don't know for sure, but I don't think it's a condition of "it was in and now it's out". Instead, it's whether it crosses that boundary (if <code>MouseX - ElemOffsetX= 1</code>). I agree, it doesn't make as much sense, but it could be because if you set the value to <code>&gt; 1</code> it would trigger the event multiple times. Otherwise it would have to keep track of the events, which is not in JS nature, seeing how it just adds events asynch to a stack.</p></li> </ol> <hr> <p>What you could try is using <a href="http://api.jquery.com/mouseleave/" rel="nofollow">jQuery's mouseleave event</a>. This does two things, which delays the firing of the event:</p> <ol> <li>It traverses the DOM tree to see if it truly left the element</li> <li>I think it implements a timeout call, which should solve the interpolation problem that you noticed.</li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload