jQuery live() and stopPropagation() issue

Posted by colourandcode on Stack Overflow See other posts from Stack Overflow or by colourandcode
Published on 2010-04-21T17:09:33Z Indexed on 2010/04/21 17:13 UTC
Read the original article Hit count: 258

Filed under:
|
|

I know that the live() event handles event bubbling different than all other jQuery events. jQuery recommends using 'return false', but in my case that doesn't work.

The issue is:

I have a DIV which contains an anchor tag.

The DIV is bound using live(). Whenever I click the anchor tag inside this DIV it bubbles and calls the DIV's event. If I bind an event to that A tag which returns false it prevents the link from opening. Neither stopPropagation() or return false work in this case. Are there any other options? Ideally I'd like to keep the live() event around.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery