Hi! In some cases your way is good. But not always. Especially moving
the mouse fast, sometimes in some cases the parent don't receive the
event but you would like to, instead.

A strange thing I'm coming across with is also using mootools built-in
mouseenter/leave . The docs say they should not be captured by
children but take a look to this test:

http://reghellin.com/debug/border-radius/

If you keep moving the mouse randomly over the elements, soon or later
even the <p> elems (the white squares) will tween. So they're in fact
capturing the event. Am I wrong?




On 5 Nov, 19:03, Sean McArthur <[email protected]> wrote:
> Does this not work out?
>
> myEl.addEvent('mouseover', function(e) {
>     if($(e.target) != myEl) return; //is a child element
>     // do the good stuff
>
> });
> On Fri, Nov 5, 2010 at 11:00 AM, stratboy <[email protected]> wrote:
> > Hi!
>
> > I was wandering: is there a way to make an element unable respond to
> > events?
>
> > I always got the same problem: I add an event (say, mouseover) to an
> > element, and also his children receive it. So for example, if I add an
> > event to an element for tweening it, and mouseover some of the
> > children, they'll tween to. We can stop the bubbling but not the
> > capture phase. Even if I  use delegation, well, not always the element
> > I :relay() on, is empty...
>
> > So it would be good to have a way to make the children nodes unable to
> > receive events. How do you generally solve this issue?
>
> > Thank you!

Reply via email to