0
我知道這裏有類似的帖子,但我找不到答案。Bootstrap手風琴:單擊另一個時不會自動摺疊
我有一個自定義佈局,但我想嘗試添加手風琴效果,但我似乎無法弄清楚爲什麼,但由於某種原因,一切正常,除非他們不會自動關閉,一旦另一個是點擊。
這裏是我的手風琴代碼:
<aside class="col-lg-4">
<div class="list-group">
<ul class="product-sorting">
<div id="accordion" role="tablist" aria-multiselectable="true" class="panel panel-group">
<li><a href="#" data-group="all" class="list-group-item active">All Products</a></li>
<li>
<a data-group="IQF" class="list-group-item" data-toggle="collapse" data-parent="#accordion" href="#collapse1" aria-expanded="false" aria-controls="collapse1">IQF Fruits (Individually Quick Frozen)
</a>
<div id="collapse1" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading1">
<div class="panel-body">
<p>Juice that is directly squeezed from a fruit/ vegetable. 100% juice contains no added sugar or preservatives.</p>
</div>
</div>
</li>
<li>
<a data-group="Fruit-Concentrate" class="list-group-item" data-toggle="collapse" data-parent="#accordion" href="#collapse2" aria-expanded="false" aria-controls="collapse2">
Fruit Juice Concentrate
</a>
<div id="collapse2" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading2">
<div class="panel-body">
<p>Juice that is directly squeezed from a fruit/ vegetable. 100% juice contains no added sugar or preservatives.</p>
</div>
</div>
</li>
<li>
<a data-group="Puree-pulp" class="list-group-item" data-toggle="collapse" data-parent="#accordion" href="#collapse3" aria-expanded="false" aria-controls="collapse3">
Fruit Puree/ Pulp
</a>
<div id="collapse3" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading3">
<div class="panel-body">
<p>Juice that is directly squeezed from a fruit/ vegetable. 100% juice contains no added sugar or preservatives.</p>
</div>
</div>
</li>
<li>
<a data-group="Puree-Concentrate" class="list-group-item" data-toggle="collapse" data-parent="#accordion" href="#collapse4" aria-expanded="false" aria-controls="collapse4">
Fruit Puree Concentrate
</a>
<div id="collapse4" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading4">
<div class="panel-body">
<p>Juice that is directly squeezed from a fruit/ vegetable. 100% juice contains no added sugar or preservatives.</p>
</div>
</div>
</li>
<li>
<a data-group="NFC" class="list-group-item" data-toggle="collapse" data-parent="#accordion" href="#collapse5" aria-expanded="false" aria-controls="collapse5">
NFC
</a>
<div id="collapse5" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading5">
<div class="panel-body">
<p>Juice that is directly squeezed from a fruit/ vegetable. 100% juice contains no added sugar or preservatives.</p>
</div>
</div>
</li>
<li>
<a data-group="Organic" class="list-group-item" data-toggle="collapse" data-parent="#accordion" href="#collapse6" aria-expanded="false" aria-controls="collapse6">
Organic
</a>
<div id="collapse6" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading6">
<div class="panel-body">
<p>Juice that is directly squeezed from a fruit/ vegetable. 100% juice contains no added sugar or preservatives.</p>
</div>
</div>
</li>
<li>
<a data-group="Dried" class="list-group-item" data-toggle="collapse" data-parent="#accordion" href="#collapse7" aria-expanded="false" aria-controls="collapse7">Dried Fruit/ Sweetened Dried Fruit
</a>
<div id="collapse7" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading7">
<div class="panel-body">
<p>Juice that is directly squeezed from a fruit/ vegetable. 100% juice contains no added sugar or preservatives.</p>
</div>
</div>
</li>
</div>
</ul>
</div>
</aside>
這是什麼樣子:
文本「汁直接從水果/蔬菜榨100%純果汁不含添加糖或防腐劑「僅僅是虛擬文本,對於所有面板都是一樣的,所以不要讓你迷惑。
我想,現在在我的代碼,不能正常工作。 - 您還需要哪些其他信息?我可以發佈更多,如果你想。 –
謝謝普拉韋什,這對我來說非常完美! – otrebla