jquery Event.stopPropagation() seems not to work

Live events don’t follow the same event bubbling rules. See the documentation on live event handling.

Quote from reference above:

Live events do not bubble in the
traditional manner and cannot be
stopped using stopPropagation or
stopImmediatePropagation. For example,
take the case of two click events –
one bound to “li” and another “li a”.
Should a click occur on the inner
anchor BOTH events will be triggered.
This is because when a
$(“li”).bind(“click”, fn); is bound
you’re actually saying “Whenever a
click event occurs on an LI element –
or inside an LI element – trigger this
click event.” To stop further
processing for a live event, fn must
return false.

Leave a Comment