Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap accordion collapse height issue

i have been using the collapse module for a while but have now found an issue with items that are quite long eg. more than a few paragraphs.

It seems that depending upon the number of items you have a height attribute is added to the outermost div as per below:

 div class="accordion in collapse" id="accordion2" style="height: 348px;"

So when you expand an item it only expands to the height given above. If I un-check this whilst in developer mode it all works perfectly.

What I can't find is where in the bootstrap.js it adds this style attribute.

like image 320
djcamo Avatar asked Nov 08 '12 01:11

djcamo


2 Answers

Try

$('#accordion2').collapse('show').height('auto');
like image 86
Costa Avatar answered Dec 27 '22 11:12

Costa


I work myself

.collapse.in {
      height: auto !important;
}
like image 29
yorkfx Avatar answered Dec 27 '22 11:12

yorkfx