I was to stop the event propagation from the child to the parent, i have a bunch of li
tags containing a
.
$('li a[rel=close]').live('click', function(e){
e.stopPropagation();
e.preventDefault();
})
But it doesn;t stop the event.Any suggestions ?
stopPropagation
has problems with live
, from the jQuery stopPropagation docs -
Since the .live() method handles events once they have propagated to the top of the document, it is not possible to stop propagation of live events
As Rob W has said your code would work fine with bind
, here's a demo - http://jsfiddle.net/TmKyT/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With