Ticket #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 |
| Blocking: | Blocked by: |
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
Change History
comment:1 Changed 5 years ago by flesler
- Cc computerkidt, flesler added
- Keywords hover, iframe added; hover removed
- Component changed from core to event
- Priority changed from critical to major
comment:4 Changed 5 years ago by computerkidt
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 5 years ago by computerkidt
Also I forgot to mention I found this bug on Firefox 2 & Firefox 3.
comment:6 Changed 5 years ago by computerkidt
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 5 years ago by Artur
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 5 years ago by Artur
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 5 years ago by Artur
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 4 years ago by brandon
- Owner set to brandon
- Milestone changed from 1.3 to 1.3.3
see also #4600 for another test case for this bug
comment:13 Changed 4 years ago by brandon
- Status changed from new to closed
- Resolution set to fixed
Fixed in r6341
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


Can you please provide a test case ? that is, a small html file with the minimum html/css/js necessary to reproduce the problem.