0
我已經使用了標準的Booststrap代碼,它曾經在開始工作,所以一旦任何部分被打開,之前打開的另一個部分被關閉。爲什麼這個Bootstrap在一個部分打開時會關閉其他人?
我已經在其中添加了一些其他的崩潰,並且確保所有ID的唯一性,除了關閉其他部分打開時關閉的一小部分時,它的工作正常。請幫我弄清楚
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel-default mainPFPanel">
<div class="mainPFPanelHeading" role="tab" id="headingMain1">
<h4 class="panel-title text-left">
<a role="button" data-toggle="collapse" data-parent="#accordion"
href="#collapseMain1" aria-expanded="true" aria-controls="collapseMain1">
ТОРТЫ
</a>
</h4>
</div>
<div id="collapseMain1" class="panel-collapse collapse in" role="tabpanel"
aria-labelledby="headingMain1">
<div class="panel-body mainPFPanelBody">
<div class="panel-group" id="accordionSub1" role="tablist" aria-multiselectable="true">
<div class="panel-default mainPFPanel">
<div class="subPFPanelHeading" role="tab" id="headingSub11">
<h4 class="panel-title text-left">
<a role="button" data-toggle="collapse" data-parent="#accordionSub1"
href="#collapseSub11" aria-expanded="true"
aria-controls="collapseCollapse11">
МУССОВЫЕ
</a>
</h4>
</div>
<div id="collapseSub11" class="panel-collapse collapse in" role="tabpanel"
aria-labelledby="headingSub11">
<div class="subPFBody">
<div class="list-group">
<a href="#" class="list-group-itemPF">Роза-Малина-Личи</a>
<a href="#" class="list-group-itemPF">Манго-Маракуйя</a>
<a href="#" class="list-group-itemPF">Черника-Ваниль-Малинаc</a>
<a href="#" class="list-group-itemPF">Клубника-Брют "ROSE</a>
<a href="#" class="list-group-itemPF">Ривьера</a>
<a href="#" class="list-group-itemPF">Клюква-Малина</a>
<a href="#" class="list-group-itemPF">Black Bourbon</a>
<a href="#" class="list-group-itemPF">Шоколад-Малина</a>
<a href="#" class="list-group-itemPF">Фисташка-Малина (вишня)</a>
<a href="#" class="list-group-itemPF">Карамель-Шоколад</a>
<a href="#" class="list-group-itemPF">Ванильно-Сливочная Груша</a>
</div>
</div>
</div>
</div>
<div class="panel-default mainPFPanel">
<div class="subPFPanelHeading" role="tab" id="headingSub12">
<h4 class="panel-title text-left">
<a class="collapsed" role="button" data-toggle="collapse"
data-parent="#accordionSub1" href="#collapseSub12"
aria-expanded="false" aria-controls="collapseSub12">
ЧИЗКЕЙКИ
</a>
</h4>
</div>
<div id="collapseSub12" class="panel-collapse collapse" role="tabpanel"
aria-labelledby="headingSub12">
<div class="subPFBody">
<div class="subPFBody">
<div class="list-group">
<a href="#" class="list-group-itemPF">Классический</a>
<a href="#" class="list-group-itemPF">Карамельный</a>
<a href="#" class="list-group-itemPF">Ягодный</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel-default mainPFPanel">
<div class="mainPFPanelHeading" role="tab" id="headingMain2">
<h4 class="panel-title text-left">
<a class="collapsed" role="button" data-toggle="collapse"
data-parent="#accordionMain" href="#collapseMain2" aria-expanded="false"
aria-controls="collapseMain2">
ТАРТЫ
</a>
</h4>
</div>
<div id="collapseMain2" class="panel-collapse collapse" role="tabpanel"
aria-labelledby="headingMain2">
<div class="subPFBody">
<div class="list-group">
<a href="#" class="list-group-itemPF">Ягодные</a>
<a href="#" class="list-group-itemPF">Лимонные</a>
<a href="#" class="list-group-itemPF">Фруктовые</a>
</div>
</div>
</div>
</div>
<div class="panel-default mainPFPanel">
<div class="mainPFPanelHeading" role="tab" id="headingMain3">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordionMain"
href="#collapseMain3" aria-expanded="false" aria-controls="collapseMain3">
ПОРЦИОННЫЕ ДЕСЕРТЫ
</a>
</h4>
</div>
<div id="collapseMain3" class="panel-collapse collapse" role="tabpanel"
aria-labelledby="headingMain3">
<div class="panel-body">
<div class="panel-default">
<div class="subPFPanelHeading" role="tab" id="headingSub31">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordionSub3"
href="#collapseSub31" aria-expanded="true"
aria-controls="collapseSub31">
МУССОВЫЕ
</a>
</h4>
</div>
<div id="collapseSub31" class="panel-collapse collapse in" role="tabpanel"
aria-labelledby="headingSub31">
<div class="subPFBody">
<div class="list-group">
<a href="#" class="list-group-itemPF">Роза-Малина-Личи</a>
<a href="#" class="list-group-itemPF">Манго-Маракуйя</a>
<a href="#" class="list-group-itemPF">Черника-Ваниль-Малинаc</a>
<a href="#" class="list-group-itemPF">Клубника-Брют "ROSE</a>
<a href="#" class="list-group-itemPF">Ривьера</a>
<a href="#" class="list-group-itemPF">Клюква-Малина</a>
<a href="#" class="list-group-itemPF">Black Bourbon</a>
<a href="#" class="list-group-itemPF">Шоколад-Малина</a>
<a href="#" class="list-group-itemPF">Фисташка-Малина (вишня)</a>
<a href="#" class="list-group-itemPF">Карамель-Шоколад</a>
<a href="#" class="list-group-itemPF">Ванильно-Сливочная Груша</a>
</div>
</div>
</div>
</div>
<div class="panel-default">
<div class="subPFPanelHeading" role="tab" id="headingSub32">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse"
data-parent="#accordionSub3" href="#collapseSub32" aria-expanded="false"
aria-controls="collapseSub32">
КЕЙКПОПСЫ
</a>
</h4>
</div>
<div id="collapseSub32" class="panel-collapse collapse" role="tabpanel"
aria-labelledby="headingSub32">
<div class="subPFBody">
<div class="list-group">
<a href="#" class="list-group-itemPF">Шоколад-Карамель</a>
<a href="#" class="list-group-itemPF">Бана-Малина</a>
<a href="#" class="list-group-itemPF">С Лимонным Курдом</a>
</div>
</div>
</div>
</div>
<div class="panel-default">
<div class="subPFPanelHeading" role="tab" id="headingSub33">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse"
data-parent="#accordionSub3" href="#collapseSub33" aria-expanded="false"
aria-controls="collapseSub33">
КАПКЕЙКИ
</a>
</h4>
</div>
<div id="collapseSub33" class="panel-collapse collapse" role="tabpanel"
aria-labelledby="headingSub33">
<div class="subPFBody">
<div class="list-group">
<a href="#" class="list-group-itemPF">Шоколад-Карамель</a>
<a href="#" class="list-group-itemPF">Бана-Малина</a>
<a href="#" class="list-group-itemPF">С Лимонным Курдом</a>
</div>
</div>
</div>
</div>
<div class="panel-default">
<div class="subPFPanelHeading" role="tab" id="headingSub34">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse"
data-parent="#accordionSub3" href="#collapseSub34" aria-expanded="false"
aria-controls="collapseSub34">
ТАРТАЛЕТКИ
</a>
</h4>
</div>
<div id="collapseSub34" class="panel-collapse collapse" role="tabpanel"
aria-labelledby="headingSub34">
<div class="subPFBody">
<div class="list-group">
<a href="#" class="list-group-itemPF">Ягодные</a>
<a href="#" class="list-group-itemPF">Лимонные</a>
<a href="#" class="list-group-itemPF">Фруктовые</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
退房的解決方案在這裏:http://stackoverflow.com/questions/14248194/close-responsive-navbar-automatically – ZombieChowder