0
我正在使用bootstrap 3
並在另一箇中定義一個nav-pills
。引導程序3中的啓發式導航藥丸不起作用
我想知道爲什麼它不能正常工作。我希望當我選擇a2
時,它會向我顯示AAAAAAAA 22222222
。我在某個地方犯了錯嗎?
內嵌代碼:
.tab-content {
padding: 5px 12px;
border: 1px solid black;
}
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<div id="maintab-out" class="container">
<ul class="nav nav-pills">
<li class="active">
<a href="#A" data-toggle="tab">A</a>
</li>
<li>
<a href="#B" data-toggle="tab">B</a>
</li>
</ul>
<div class="tab-content clearfix">
<div class="tab-pane active" id="A">
<div>
<div id="maintab-A" class="container">
<ul class="nav nav-pills">
<li class="active">
<a href="#a1" data-toggle="tab">a1</a>
</li>
<li>
<a href="#a2" data-toggle="tab">a2</a>
</li>
</ul>
<div class="tab-content clearfix">
<div class="tab-pane active" id="#a1">
<div>
AAAAAAAA 11111111
</div>
</div>
<div class="tab-pane" id="#a2">
<div>
AAAAAAAA 22222222
</div>
</div>
</div>
<!-- (tab-content) -->
</div>
<!-- (container) -->
</div>
</div>
<div class="tab-pane" id="B">
<div>
<div id="maintab-B" class="container">
<ul class="nav nav-pills">
<li class="active">
<a href="#b1" data-toggle="tab">b1</a>
</li>
<li>
<a href="#b2" data-toggle="tab">b2</a>
</li>
</ul>
<div class="tab-content clearfix">
<div class="tab-pane active" id="#b1">
<div>
BBBBBBBB 11111111
</div>
</div>
<div class="tab-pane" id="#b2">
<div>
BBBBBBBB 22222222
</div>
</div>
</div>
<!-- (tab-content) -->
</div>
<!-- (container) -->
</div>
</div>
</div>
</div>
<!-- (maintab-out) -->
<!-- ****************************** -->
<div class="container theme-showcase" role="main">
</div>
<!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="js/jquery.js"><\/script>')
</script>
<script src="js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="assets/js/ie10-viewport-bug-workaround.js"></script>
<script>
$(function() {
$("#maintab-A").width($("#maintab-A").width() - 100);
});
</script>