daniel.sedlacek
daniel.sedlacek

Reputation: 8629

collapse('show') breaks toggling in Bootstrap3 collapse

I have Bootstrap3 collapse that toggles nicely - that is when I open one section the other section gets closed.

I want my collapse to start opened on specific section so I call:

$('mysection').collapse('show'); 

It works but since that moment that section will not toggle-close the other section when opened by mouse click.

http://jsfiddle.net/rh4vcbxd/

Upvotes: 1

Views: 63

Answers (1)

tmg
tmg

Reputation: 20393

Try add in class to the default open section, as documented. If you want to open it via javascript then you can do like

$(document).ready(function(){
      $("[data-target='#sectionId']").trigger('click');
})

http://jsfiddle.net/rh4vcbxd/1/

Upvotes: 2

Related Questions