我有这段代码:http://www.bootply.com/A6h7uQRmSt
这就是bootstrap 2的样子:http://jsfiddle.net/qdqrT/121/
<div class="accordion" id="accordion2">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
Collapsible Group Item #1
</a>
</div>
<div id="collapseOne" class="accordion-body collapse">
<div class="accordion-inner">
Anim pariatur cliche...
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
Collapsible Group Item #2
</a>
</div>
<div id="collapseTwo" class="accordion-body collapse">
<div class="accordion-inner">
Anim pariatur cliche...
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseThree">
Collapsible Group Item #3
</a>
</div>
<div id="collapseThree" class="accordion-body collapse">
<div class="accordion-inner">
This is where i do not need child elements
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseFour">
Collapsible Group Item #4
</a>
</div>
<div id="collapseFour" class="accordion-body collapse">
</div>
</div>
</div>
我可以问为什么它与bootstrap 3有所不同?在两者之间是否有一些类的名称发生了变化,如果是这样,是否有人能够告诉我bootstrap3的等价物是什么?
答案 0 :(得分:2)
Bootstrap v3是一次重大的升级,所以v2和v3之间发生了很多变化。您需要更新HTML标记以符合新的更改,否则事情将无法按预期工作。基本上,v3不向后兼容v2。