Skip to content
Permalink
Browse files

Added a fix for the hover mouseover/mouseout problem.

  • Loading branch information
jeresig committed Jul 5, 2006
1 parent 32548da commit fde7edc456dac52fe43651b8e074ec6ed13d23f2
Showing with 3 additions and 1 deletion.
  1. +3 −1 event/event.js
@@ -31,7 +31,9 @@ jQuery.prototype.hover = function(f,g) {
// A private function for haandling mouse 'hovering'
function handleHover(e) {
// Check if mouse(over|out) are still within the same parent element
var p = e.fromElement || e.toElement || e.relatedTarget;
var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;

// Traverse up the tree
while ( p && p != this ) p = p.parentNode;

// If we actually just moused on to a sub-element, ignore it

0 comments on commit fde7edc

Please sign in to comment.
You can’t perform that action at this time.