On Fri, Nov 27, 2009 at 6:12 AM, Danny <slayerfoe...@sina.com> wrote:
> [ ... ] I downloaded jdMenu 1.3.beta2 and it worked fine. However I
> found that the jQuery version in the plugin is 1.1.2 so I replaced it
> with 1.3.2. Then the trouble comes.
> [ ... ] In the plugin jdMenu.js the author uses $(li).hover
> (hoverOverLI,hoverOutLI)  to register the events but in the 1.3.2
> version, the hoverOverLI function is triggered only once and then it
> is never triggered. [ ... ]

Without spending too much time at this, I find that it looks as though
that plug-in used the implementation of hover internally rather than
just relying on its public interface.  When the implementation
changed, that plug-in wouldn't work.

In the 1.2.1 version of jQuery, hover used mouseover and mouseout
events with some additional logic to ensure that these events weren't
happening when the mouse entered a sub-element.  In 1.3.2, that logic
has been encapsulated elsewhere, and hover uses mouseenter and
mouseleave.

If your fix works for you, that's fine.  I think a better one would be
to replace jdMenu's use in addEvents(ul) of

    $('> li', ul).
        hover((hoverOverLI, hoveIOutLI) // ...

with

    $(('> li', ul).
        .mouseenter(hoverOverLI)
        .mouseleave(hoverOutLI) // ...

and the equivalent for the unbinding in removeEvents(ul).

This is not a bug in hover, just a changed implementation, which the
plug-in was depending upon.

  -- Scott

--

You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-...@googlegroups.com.
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en.


Reply via email to