#3286 closed bug (fixed)
Hover Glitch/Bug
Reported by: | computerkidt | Owned by: | brandon |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | event | Version: | 1.2.6 |
Keywords: | hover, iframe | Cc: | computerkidt, flesler |
Blocked by: | Blocking: |
Description
.hover() when put in a frame that has a scroller bar always acts up like when you put your mouse in the hover area it activates but when you move the mouse out of the area thru the side with the scroller bar it will not deactivate. This bug is the same in jquery v1.2.3 and v1.2.6.
Attachments (1)
Change History (13)
comment:1 Changed 15 years ago by
Cc: | computerkidt flesler added |
---|---|
Component: | core → event |
Keywords: | iframe added |
Priority: | critical → major |
comment:2 Changed 15 years ago by
need: | Patch → Test Case |
---|
comment:4 Changed 15 years ago by
I made you a sample you can view the bug in a frame at: http://www.armyoffate.com/hoverbug.php The actual coding is at http://www.armyoffate.com/hoverbug2.php but you can only see the bug in action from the first link.
If you need anything else let me know. Also please let me know once you have a patch or fix for this because this is a huge problem on my site.
Thanks, Terrence
comment:5 Changed 15 years ago by
Also I forgot to mention I found this bug on Firefox 2 & Firefox 3.
comment:6 Changed 15 years ago by
I added a menu to the top frame so you can see how each jquery type & version does. It's seperate from the hoverbug2.php frame so it doesn't add any code to it.
comment:7 Changed 15 years ago by
solution : 2405c2405 < while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { parent = elem; } ---
while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { return false; }
end
in function :
Checks if an event happened on an element within another element Used in jQuery.event.special.mouseenter and mouseleave handlers var withinElement = function(event, elem) {
Check if mouse(over|out) are still within the same parent element var parent = event.relatedTarget; Traverse up the tree while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { parent = elem; } Return true if we actually just moused on to a sub-element return parent == elem;
};
when you move mouse outside the elem directly to slider ff puts xul element to event.relatedTarget. this causes exception on parent.parentNode (because you cannot access it) so the function returns that slider is inside elem. I'm not sure if this solution works in every case, but cannot find case in with it crashes.
cheers Artur
PS. sorry for bad English
comment:8 Changed 15 years ago by
sorry for previous post :P
Solution :
2405c2405 < while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { parent = elem; } --- > while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { return false; }
in function :
// Checks if an event happened on an element within another element // Used in jQuery.event.special.mouseenter and mouseleave handlers var withinElement = function(event, elem) { // Check if mouse(over|out) are still within the same parent element var parent = event.relatedTarget; // Traverse up the tree while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { parent = elem; } // Return true if we actually just moused on to a sub-element return parent == elem; };
when you move mouse outside the elem directly to slider ff puts xul element to event.relatedTarget. this causes exception on parent.parentNode (because you cannot access it) so the function returns that slider is inside elem. I'm not sure if this solution works in every case, but I cannot find case in which it crashes.
cheers Artur
PS. sorry for bad English
comment:10 Changed 15 years ago by
just replace:
while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { parent = elem; }
with:
while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { return false; }
in your jquery-1.2.6.js script
comment:12 Changed 14 years ago by
Milestone: | 1.3 → 1.3.3 |
---|---|
Owner: | set to brandon |
see also #4600 for another test case for this bug
Can you please provide a test case ? that is, a small html file with the minimum html/css/js necessary to reproduce the problem.