Skip to content
Advertisement

Mouse event weirdness

Here is the Greasemonkey script I’m working on (source below): http://userscripts.org/scripts/show/69722

You can test it out on this page: http://forums.whirlpool.net.au/forum/35

Hover over a thread title and a div appears with a preview.

The weird thing is, when you move your mouse around on the div, the mouseout event is getting fired for some reason.

Anyone have any ideas as to why this is happening?

JavaScript

Advertisement

Answer

This is one of the problems with mouseout vs mouseleave. (One place IE did something right. Imagine that!)

Mouseout fires when you move into a child element, whereas mouseleave only fires when you move off the element AND all child elements.

See http://www.quirksmode.org/dom/events/index.html#t28 for more info.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement