我正在使用折叠插件,我想知道如何使多个组可以同时打开。在他们的演示页:
http://twitter.github.com/bootstrap/javascript.html#collapse
在给定时间只允许打开一个。我想这是手风琴的预期行为,但是我怎么改变它,使得打开一个组不会折叠其他组?
解决方法
只是不使用data-parent属性:
<div class="accordion" id="accordion2"> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" href="#collapSEOne"> Collapsible Group Item #1 </a> </div> <div id="collapSEOne" class="accordion-body collapse in"> <div class="accordion-inner">Item 1 Body</div> </div> </div> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" href="#collapseTwo"> Collapsible Group Item #2 </a> </div> <div id="collapseTwo" class="accordion-body collapse"> <div class="accordion-inner">Item 2 Body</div> </div> </div> </div>