If the mouse is in the target zone and you're moving it, the mouseOver event
should not be triggered. You can test this by mousing over just one of the
"target" LI tags. If you stay within that LI and keep your mouse moving the
sensitivity threshold is never met (because for sake of testing I reduced it
to 1... so the mouse has to be motionless for the threshold to be crossed).

When you mouseOut of li.p4 into li.p3 (for example), li.p3's mouseOver event
should not be triggered as long as your mouse is moving. However, li.p4's
mouseOut function for some reason trips up li.p3's hoverIntent function...
or more specifically li.p3's mousemove listener. Without that listener the
coordinates for your mouse do not update, so the polling interval (which
compares coordinates) thinks your mouse has stopped moving.

Turning the polling interval down would only speed up this last step
(coordinate comparison). Otherwise it has no effect. Once this bug is fixed,
I'll dial it down and increase the threshold to an acceptable level.

Removing animate() from the mouseOut function is the only thing that stops
this bug from happening.

In Firebug, I'm logging what object (li) is inside
compareMouseCoordinates(). If you change that to show the mouse coordinates,
you'll see that they are "frozen" after another li's animate mouseOut
function is called.

Brian.



On 3/24/07, Dan G. Switzer, II <[EMAIL PROTECTED]> wrote:

 Brian,



From my playing around it seems that it gets triggered because mouse is in
the target zone at each check (even though it's been moved around a lot.)
Does the bug go away if you lower the interval way down?



-Dan


  ------------------------------

*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Brian Cherne
*Sent:* Saturday, March 24, 2007 7:44 PM
*To:* jQuery Discussion
*Subject:* [jQuery] hoverIntent r3 -- animate vs. hoverIntent



I've re-written hoverIntent since the last time I posted. It now has
configurable options, a mouseOut timeout, and is $-friendly.

However, not all is good in the land of hoverIntent. I've been struggling
with this one bug for a while (hence the delay since my last update) and
I've finally (sucked up my pride and) decided to approach the list for help.


I have some example code on my web site that explains the problem in
detail.
<http://cherne.net/brian/resources/jquery.hoverIntent.html >
(demo requires Firefox and Firebug)

Simply put, when multiple instances of hoverIntent are in-play the
mouseOut of one can kill the mouseMove of another. This happens when the
mouseOut uses animate(). Functions like html() do not kill the other
instance of hoverIntent.

And when hoverIntent is killed, the polling interval lives on (presumably
because timers/intervals live in a different context). Unfortunately, the
mouseMove function of hoverIntent isn't updating the "current" set of mouse
coordinates (because it was killed), so the polling interval compares frozen
coordinates and of course they're the same, thus triggering an accidental
mouseOver.

I can see the symptoms, but I don't understand what's going on. Can
someone explain what's happening and suggest a way to fix it? And why it
breaks with animate() but not html() is also a mystery...

Note, this problem exists in the much simpler r1. It is not something I
introduced with the inclusion of the mouseOut timeout.

Thanks in advance,

Brian.

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to