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 stopPropagation
method of the event
object.
$(".accordion").on("shown",function(event) {
event.stopPropagation();
});
http://jsfiddle.net/SPZZv/
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