Wow now that's what I'm talkin about!  Well done all!  Keep'em coming,
if we haven't covered them already.

cheers.

Joe

On Aug 15, 10:38 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> On Aug 15, 2008, at 8:32 PM, Michael Geary wrote:
>
>
>
> >>> From: Michael Geary
> >>> It's worth noting the implementation of the .hover() method:
>
> >>>   hover: function(fnOver, fnOut) {
> >>>      return this.bind('mouseenter', fnOver).bind('mouseleave',  
> >>> fnOut);
> >>>  },
>
> >>> As you can see, hover does nothing more than hook up
> >>> the 'mouseenter' and 'mouseleave' events to your two handlers.
> >>> So, if you only need to listen for one of these events and not both,
> >>> it's perfectly OK to use one of those two events (but not, as you
> >>> note, mouseover and mouseout).
>
> >> From: Karl Swedberg
>
> >> Glad you brought this up, Michael!
>
> >> A couple things to note about this:
>
> >> 1. The .hover() wasn't always written that way internally. It
> >> was a change in one of the 1.2.x versions. So if you're using
> >> an old version of jQuery, you might want to double check for
> >> those mouseenter and mouseleave events before attempting to use them.
>
> >> 2. At this point there is no shorthand .mouseenter(fn) or
> >> .mouseleave(fn) like this is .mouseover(fn) and
> >> .mouseout(fn). Instead, we have to use .bind('mouseenter',
> >> fn) and .bind('mouseleave', fn)
>
> > Ah... So I could be way off base in suggesting that the mouseenter and
> > mouseleave events are fair game. I saw that .hover was using them  
> > and figure
> > it must be OK! Clearly a case of monkey see, monkey do coding. For  
> > all I
> > knew, they could have been intended for internal use only and  
> > subject to
> > change. After all, they are not documented.
>
> > So what's the intent with these two events? Are they intended for  
> > apps to
> > use and will remain stable - in that case they just need to be added  
> > to the
> > documentation.
>
> > Thanks,
>
> > -Mike
>
> Hey Mike,
>
> I don't think you're off base. It's my impression that the two events  
> are sticking around. But, then again, it's just an impression. And  
> it's just mine.
>
> They actually are in the documentation -- but they're kind of hidden:
>
> Possible event values: blur, focus, load, resize, scroll, unload,  
> click, dblclick,  mousedown, mouseup, mousemove, mouseover, mouseout,  
> mouseenter, mouseleave, change, select,  submit, keydown, keypress,  
> keyup, error
>
> (http://docs.jquery.com/Events/bind#typedatafn)
>
> They were also mentioned in the Release Notes for jQuery 1.2.2 [1].  
> I'd love to see them given their own shorthand methods to put them on  
> par with their mousey brethren.
>
> Not sure, but it could be just a matter of adding them to the list  
> around line 2386:
>
> jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
>         "mousedown,mouseup,mousemove,mouseover,mouseout,change,select," +
>         "submit,keydown,keypress,keyup,error").split(","), function(i, name){
>
>         // Handle event binding
>         jQuery.fn[name] = function(fn){
>                 return fn ? this.bind(name, fn) : this.trigger(name);
>         };
>
> });
>
> I've been meaning to mention this on the dev list, but it keeps  
> slipping my mind. And I'm a little shy about suggesting such things.  
> Anyway, it's always a pleasure corresponding with you. Any chance at  
> all you can make it to the jQuery Conference next month? Would be  
> great to meet you!
>
> [1]http://docs.jquery.com/Release:jQuery_1.2.2#.bind.28.22mouseenter.22....
>
> --Karl
> ____________
> Karl Swedbergwww.englishrules.comwww.learningjquery.com

Reply via email to