I have a nested Bootstrap Collapse with a shown event firing on both the parent and the child Collapse. I need it to only fire on the parent Collapse and not on the child.
$(document).ready(function() {
$("#accordion2").on("shown",function() {
alert("shown!");
});
});
Here’s an example: http://jsfiddle.net/xb9K6/
You can use
stopPropagationmethod of theeventobject.http://jsfiddle.net/SPZZv/