Skip to main content

Bug Tracker

Side navigation

#3286 closed bug (fixed)

Opened August 25, 2008 05:37AM UTC

Closed May 06, 2009 01:24AM UTC

Last modified March 14, 2012 04:18PM UTC

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 (12)

Changed August 26, 2008 06:21PM UTC by flesler comment:1

cc: → computerkidt, flesler
component: coreevent
keywords: hoverhover, iframe
priority: criticalmajor

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

Changed August 26, 2008 06:21PM UTC by flesler comment:2

need: PatchTest Case

Changed August 26, 2008 11:34PM UTC by computerkidt comment:3

I'll code one up today and post the link

Changed August 27, 2008 01:42AM UTC by computerkidt comment:4

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

Changed August 27, 2008 02:02AM UTC by computerkidt comment:5

Also I forgot to mention I found this bug on Firefox 2 & Firefox 3.

Changed August 27, 2008 02:18AM UTC by computerkidt comment:6

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.

Changed August 30, 2008 08:53PM UTC by Artur comment:7

//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

Changed August 30, 2008 09:07PM UTC by Artur comment:8

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

Changed September 01, 2008 02:54PM UTC by computerkidt comment:9

So how would I edit that into my script???

Changed September 02, 2008 08:34PM UTC by Artur comment:10

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

Changed May 06, 2009 01:17AM UTC by brandon comment:11

milestone: 1.31.3.3
owner: → brandon

see also #4600 for another test case for this bug

Changed May 06, 2009 01:24AM UTC by brandon comment:12

resolution: → fixed
status: newclosed

Fixed in r6341