When you expand or collapse the accordion, it simply adds / removes the "in" class and sets the height:auto or 0 to the accordion div.
Demo
So, in your accordion, when you define it, simply remove the "in" class from the div, as shown below. Whenever you extend accorion, it simply adds the "in" class to make it visible.
If you render the page using "in", then bootstrap will look for the class, and it will make the height div: auto, if it is not specified, it will be at zero height.
<div id="collapseOne" class="accordion-body collapse">
PSL Apr 22 '13 at 22:45 2013-04-22 22:45
source share