JuliaCesar JuliaCesar - 1 year ago 141
Javascript Question

Twitter Bootstrap: Accordion plugin collides with Modal

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.

Answer Source

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) {

Hope hat helps you.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download