Hi Ted, when hoverIntent was written (almost 2 years ago) jQuery didn't have
mouseenter or mouseleave. The hover method at the time did ignore over/out
events from child elements and hoverIntent has that code as well -- so it
simulates mouseenter and mouseleave in that respect. So you could write:

$("li.main-nav").hoverIntent( yourToggleFn, yourToggleFn );

The next version of hoverIntent will actually bind mouseenter and mouseleave
(like today's hover), and also provide hoverIntent events (using .bind)
while maintaining backwards compatibility with current hoverIntent installs.
I don't have an ETA for the next version. I've given numerous estimates and
have just as many apologies to send. It is high on my list of personal
priorities, but when it will actually hit is anyone's guess. (publicly
shaming myself like this should help get it done sooner!) :)

There is a "hover" special event plugin written by someone else that
override's jQuery's built-in hover. It is similar to hoverIntent if you need
something today that will use .bind(). <
http://blog.threedubmedia.com/2008/08/eventspecialhover.html>

Brian.


On Tue, Jan 13, 2009 at 5:24 AM, Ted <theodorew...@gmail.com> wrote:

>
> Is it possible to setup hoverIntent like delays when using mouseenter,
> mouseleave? I did some digging in to hoverIntent, but didn't see any
> support for the mouseenter/mouseleave triggers. Is there a way to do
> this in Jquery? I've got the following bit of code triggering a menu,
> but I'd like a small delay on triggering, since the div that is being
> load is a menu, and with the fade-in, I want to be sure the user
> intended to call the menu.
>
> jQuery.fn.fadeToggle = function(speed, easing, callback) {
>                                        return this.animate({opacity:
> 'toggle'}, speed, easing,
> callback);
>                                };
>
>                                $("li.main-nav").bind("mouseenter
> mouseleave", function(){
>                                $(this).children('div').fadeToggle();
>                                $(this).toggleClass('menu-on');
>                                return false;
>                            });
>

Reply via email to