/ Published in: JavaScript
So the event is fired only once when hovering over child elements
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// this function determines whether the event is the equivalent of the microsoft // mouseleave or mouseenter events. function isMouseLeaveOrEnter(e, handler) { if (e.type != 'mouseout' && e.type != 'mouseover') return false; var reltg = e.relatedTarget ? e.relatedTarget : e.type == 'mouseout' ? e.toElement : e.fromElement; while (reltg && reltg != handler) reltg = reltg.parentNode; return (reltg != handler); }
URL: http://www.dynamic-tools.net/toolbox/isMouseLeaveOrEnter/