[英]Bootstrap: Accordion Collapse stopped working with Bootstrap 2.0.3
我的手風琴使用data-toggle="collapse"
和data-parent="#selector"
適用於Bootstrap 2.0.2,但是當我切換到2.0.3時,手風琴功能停止工作。
它仍會打開和關閉目標 div
,但是當單擊另一個帶有data-toggle="collapse"
td
時,它不會自動關閉打開的目標 div
。
你可以在這里看到它不能與2.0.3一起使用: http : //chooserealtoday.com/#faq
以下代碼示例也在JSFiddle上,網址為http://jsfiddle.net/N7MN9/3/ 。
<table id="faq-table" class="table table-bordered">
<tr>
<td class="question" data-toggle="collapse" data-target="#answer1" data-parent="#faq-table">
<p><strong>What is your name?</strong></p>
<div id="answer1" class="answer collapse">
<p>Mark Rummel</p>
</div>
</td>
</tr>
<tr>
<td class="question" data-toggle="collapse" data-target="#answer2" data-parent="#faq-table">
<p><strong>What is your favorite color?</strong></p>
<div id="answer2" class="answer collapse">
<p>Blue, no yellow.</p>
</div>
</td>
</tr>
</table>
感謝您提供的任何幫助!
我看到兩個選擇
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
由2.0.2版本:
actives = this.$parent && this.$parent.find('.in')
您可以在不修改Bootstrap文件的情況下解決此問題:只需輸入.accordion-group類。
我寫了這個擴展名以允許使用表格折疊。 它允許您指定用於在折疊組中查找活動同級的選擇器。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.