Guaranteeing the onmouseout event to fire

Posted by n3rd on Stack Overflow See other posts from Stack Overflow or by n3rd
Published on 2010-05-07T10:06:12Z Indexed on 2010/05/07 10:08 UTC
Read the original article Hit count: 243

Filed under:
|

Hello everybody,

I'm currently developing a web application and have run into a little problem. I'm using ExtJS, but I believe this to be a general JS question.

When the cursor enters an HTML element, the onmouseover event is fired, when the cursor leaves that element, onmouseout is triggered. So far, so good. Unfortunately, it seems one can't fully rely on this behaviour. Very quick mouse movements can cause the event not to fire (as does repositioning the cursor with a pen tablet, for example).

What are the best practices to handle these issues? Do I need to monitor all onmousemove events and manually keep track of where the cursor was last and fire the appropriate onmouseout event myself?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about events