我对 Bootstrap 选项卡/药丸插件有疑问。
我想显示所有div
(a
和) b
,c
所以我不需要标签来隐藏它们。我想要药丸让用户在页面上从一个部分移动到另一个部分。问题:
- 当用户单击链接时,不显示内容(容器
a
和的示例b
)。 - 显示删除
data-toggle="pill"
内容,但链接未标有.active
类。
我准备了这个小提琴:http: //jsfiddle.net/DLRmp/向您展示问题。希望你能帮助我,关于药丸的文档似乎有点差:
<ul class="nav nav-pills nav-stacked">
<li class="active"><a data-toggle="pill" href="#a">a</a></li>
<li class=""><a data-toggle="pill" href="#b">b</a></li>
<li class=""><a href="#c">c</a></li>
</ul>
<div id="a">I'm not working: when user clicks the link nothing happens.
But at least link is marked as active!</div>
<div id="b">Me too. I'm not working: when user clicks the link nothing happens.
But at least link is marked as active! </div>
<div id="c">I'm working, but link is not marked as active!</div>