When you expand or collapse accordion it just adds/removes a class "in" and sets the height:auto
or 0
to the accordion div.
Demo
So in your accordion when you define it just remove "in" class from the div as below. Whenever you expand an accorion it just adds the "in" class to make it visible.
If you render the page with "in" bootstrap looks for the class and it will make the div's height:auto, if it not present it will be at zero height.
<div id="collapseOne" class="accordion-body collapse">
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…