我试图在没有javascript的情况下设置bootstrap标签(如此处写的:http://getbootstrap.com/javascript/#markup)。
从bootstrap页面复制的代码:
<div>
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Home</a></li>
<li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">Profile</a></li>
<li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">Messages</a></li>
<li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">Settings</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="home">Tab 1</div>
<div role="tabpanel" class="tab-pane" id="profile">Tab 2</div>
<div role="tabpanel" class="tab-pane" id="messages">Tab 3</div>
<div role="tabpanel" class="tab-pane" id="settings">Tab 4</div>
</div>
</div>
https://jsfiddle.net/Zoker/w6xeyznk/
正如你所看到的,它不起作用,我不知道为什么。有人有个主意吗?
答案 0 :(得分:0)
您是否已将jquery.js和bootstrap.js包含在内,因为您不必编写js部分,但bootstap已经拥有它。
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>