git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
32548da
)
Added a fix for the hover mouseover/mouseout problem.
author
John Resig
<jeresig@gmail.com>
Wed, 5 Jul 2006 02:07:20 +0000
(
02:07
+0000)
committer
John Resig
<jeresig@gmail.com>
Wed, 5 Jul 2006 02:07:20 +0000
(
02:07
+0000)
event/event.js
patch
|
blob
|
history
diff --git
a/event/event.js
b/event/event.js
index
1b3bd77
..
fe6e621
100644
(file)
--- a/
event/event.js
+++ b/
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
// 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
while ( p && p != this ) p = p.parentNode;
// If we actually just moused on to a sub-element, ignore it