I have a delegation parent that listen for click events in a set of children with a specific class.
$(".toggle_group").on("click",".toggle",function(e){ .. });
so heres an example of the html
<div class='toggle_group'>
<a class='toggle'>click me and i toggle <div>Im a child of toggle</div></a>
<a class='toggle'>click me and i toggle <div>Im a child of toggle</div></a>
<a class='toggle'>click me and i toggle <div>Im a child of toggle</div></a>
<a class='toggle'>click me and i toggle <div>Im a child of toggle</div></a>
</div>
the problem is that children of a.toggle
propogate the event to the parent triggering the handler when it shouldn't. According to jQuery docs you cant stop event propagation on live/delegated event listeners.
How do I stop these sub children of a.toggle from propogating the event to the parent? or maybe in some cases permit it?
You see the inner div of .toggle
is supposed to be a drop down menu. It shouldnt toggle when you click the menu, only when you click the toggle link...