http://www.quirksmode.org/js/events_order.html

Your issue is one of event bubbling.

If the second object is created inside the the first handler, and is properly added to the DOM, then events will bubble from it normally.

The trick here is deciding if you want an event to bubble up/down or simply halt. With jQuery - simply return false from your event handler to halt the bubbling. In addition you may need to call e.stoppropagation() (I think that's the method..) - just to get the cross browser thing working properly.

HTH

Shawn

jquertil wrote:
not sure if my problem actually can be solved - it might be to
inconsistent with the event logic of any programming language... bt
anyhow, here goes:

1. a mouse rolls over an element, firing the mouseover event.
2. the action bound to the mouseover executes
3. the mouse rolls off the element, firing the mouseout event
4. the action bound to the mouseout event executes.

The twist:
while still *inside* the element, the mouse rolls over *another*
element which was created in step 2. , thus firing the mouseout. This
is not supposed to happen.

Now what?

Thanks for thinking about this...

Reply via email to