I was faced with a problem when using an accordion in the pop-up modal (all are Twitter Bootstrap plugins). Modal has closed whenever any accordion block was toggled.
Accordion collapse fires a 'hidden' event, which is actual for Modal plugin too. So, there is a way to prevent modal closing:
$(document).on('click', 'a.accordion-toggle', function(e) {
$(e.target).parent().siblings('.accordion-body').on('hidden', function(e) {
e.stopPropagation();
});
});
Hope hat helps you.
@JuliaCesar Your answer did not work for me but it pointed me to a solution:
$('.collapse').on('hidden', function(e){
e.stopPropagation();
});
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