Diego, on IE custom events can't be cancelled. fireEvent will always
fire an event that bubbles. 
http://msdn.microsoft.com/en-us/library/ms536423(VS.85).aspx

That's why I'm for making Element#observe handle mouseenter/leave in
the core. Firing and then filtering custom events goes against the
point of making this easy to use. These events should not bubble, this
can't be done with custom events, therefore the observe approach is
the better one.

I've been saying this for some time but custom events seem to be used
as an excuse not to implement this properly, like other frameworks
have done. Of course it can be done with custom events but it's
clearly not the best approach. Ah well, I guess this needs more time
before others draw the same conclusion.

--
Nick


On 11 jun, 03:08, Diego Perini <[EMAIL PROTECTED]> wrote:
> I am probably missing something, but...
>
> Why not use mouseover / mouseout on all browser and then use
> "event.stopPropagation()" method or "event.cancelBubble=true" for IE ?
>
> Are there browsers where the bubbling phase of these events can't be
> cancelled ?
>
> --
> Diego Perini
>
> On 10 Giu, 21:58, Nick Stakenburg <[EMAIL PROTECTED]> wrote:
>
> > Andrew has a script that shows how to do it with custom 
> > events:http://github.com/savetheclocktower/javascript-stuff/tree/master/cust...
>
> > It's not as convenient as real mouseenter/mouseleave behaviour,
> > because these event will bubble. Child elements will fire mouse:enter/
> > mouse:leave events onto their parent. You'd have to filter out these
> > unwanted event before this will work.
>
> > I'd prefer something similar as the patch Ken posted implemented into
> > core. It doesn't have the overhead and is much more convenient since
> > it allows you to do this:
> > $(element).observe('mouseleave', handler);
>
> > jQuery and Mootools use a similar approach. It's much closer to the
> > spec, since it doesn't involve event bubbling like the real mouseenter/
> > mouseleave events.
>
> > On 10 jun, 21:10, Alex K <[EMAIL PROTECTED]> wrote:
>
> > > Hi Guys, I've suffered IE weird bug:
>
> > >  this browser sends onmouseout events even if the mouse is actually
> > > within the scope of the element, this happens when the mouse is over
> > > the child element. There is a way to solve this, IE send the proper
> > > event with name 'mouseleave', so my code looks like:
>
> > > //one more weird IE bug
> > > var mouse_out_event_name =
> > > Prototype.Browser.IE?'mouseleave':'mouseout';
> > > Event.observe(list_item,mouse_out_event_name,this.onmouseout.bindAsEventListener(this));
>
> > > Just a thought that it can be handled by the lib to save time of other
> > > folks,
> > > Thanks,
> > > Alex
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to