You are correct. mouseenter is determined by checking the
event.relatedTarget, which as MDC puts it, should be the Element it is
exiting, or which element will fire a mouseout at the same time. Thus, I
assume that since the boxes are changing sizes, when moving your cursor over
them, sometimes the element it is exiting is the HTML element, or similar
higher up element.

Still, if you did a check for `if(this != $(e.target))`, my debugging on
your page shows that to be the behavior you desire.



On Fri, Nov 5, 2010 at 11:15 AM, stratboy <[email protected]> wrote:

> 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