我想将下拉菜单和折叠菜单混合在一起,但是当我在下拉菜单中实现手风琴时,您无法单击手风琴切换。下拉菜单向上滑动。
这是我的代码。
<ul class="nav nav-pills">
<li class="dropdown" id="menu1">
<a class="dropdown-toggle" data-toggle="dropdown" href="#menu1">
Dropdown
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="#">Action</a>
</li>
<li class="divider"></li>
<li>
<a href="#">Separated link</a>
</li>
<li>
<div class="accordion" id="accordion2">
<div class="accordion-group">
<a class="accordion-toggle"
data-toggle="collapse"
data-parent="#accordion2"
href="#demo1">
aaa
</a>
<div id="demo1" class="accordion-body collapse" style="height: 0px; ">
<ul class="index-list">
......
</ul>
</div>
</div>
<div class="accordion-group">
<a class="accordion-toggle"
data-toggle="collapse"
data-parent="#accordion2"
href="#demo2">
aaa
</a>
<div id="demo2" class="accordion-body collapse">
<ul class="index-list">
......
</ul>
</div>
</div>
</div>
</li>
</ul>
</li>
...
</ul>
这是 jsFiddle 的链接:http: //jsfiddle.net/DBQU7/26/