本文介绍了折叠插件:一次只显示一个面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我很难弄清楚这一点,也许我只是没有搜索正确的术语。
I'm having a hard time figuring this out, and maybe I'm just not searching the right terms.
我有一个常规的Twitter崩溃面板。我只希望它一次显示一个面板。
I have a regular twitter collapse panel. I only want it to show one panel at a time.
默认情况下,它允许您一次打开所有面板,但是我希望它自动关闭任何面板。
By default, it allows you to open all of the panels at once, but I want it to automatically close any other open panel when you expand another one.
<div class="accordion" id="monogram-acc">
<div class="accordion-group">
<div class="accordion-heading">
<div class="accordion-toggle" data-toggle="collapse" data-parent="monogram-acc" href="#Animals">
Animals
</div>
</div>
<div class="accordion-body collapse" id="Animals">
//... content
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<div class="accordion-toggle" data-toggle="collapse" data-parent="monogram-acc" href="#Food">
Food
</div>
</div>
<div class="accordion-body collapse" id="Food">
// ... content
</div>
</div>
//... so on
</div>
推荐答案
更改
data-parent="monogram-acc"
到
data-parent="#monogram-acc"
这篇关于折叠插件:一次只显示一个面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!