有没有办法可以点击链接并在同一页面上打开特定的引导标签?
这是我的代码:
<ul class="nav nav-tabs">
<li class="active"><a href="#1" data-toggle="tab">BMR Calculator</a></li>
<li><a href="#3" data-toggle="tab">Body Fat Calculator</a></li>
<li><a href="#4" data-toggle="tab">Heart Calculator</a></li>
<li><a href="#5" data-toggle="tab">BMI Calculator</a></li>
</ul>
Don't know fat percentage, please <a href="#3">click here</a>
答案 0 :(得分:0)
只需填写下面的附加链接 -
不知道脂肪百分比,请<a href="#three" data-toggle="tab">click here</a>
除了您不能使用数字值作为ID的事实 元素,请参考HTML 5
答案 1 :(得分:0)
在您打开标签的链接中添加<a data-toggle="tab" href="#3">click here</a>
data-toggle="tab"
。
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<ul class="nav nav-tabs">
<li class="active"><a href="#1" data-toggle="tab">BMR Calculator</a></li>
<li><a href="#3" data-toggle="tab">Body Fat Calculator</a></li>
<li><a href="#4" data-toggle="tab">Heart Calculator</a></li>
<li><a href="#5" data-toggle="tab">BMI Calculator</a></li>
</ul>
<div id="1" class="tab-pane fade in active">
<h3>HOME</h3>
<p>Some content.</p>
</div>
<div id="3" class="tab-pane fade">
<h3>Menu 1</h3>
<p>Some content in menu 1.</p>
</div>
<div id="4" class="tab-pane fade">
<h3>Menu 2</h3>
<p>Some content in menu 2.</p>
</div>
<div id="5" class="tab-pane fade">
<h3>Menu 5</h3>
<p>Some content in menu 2.</p>
</div>
Don't know fat percentage, please <a data-toggle="tab" fa href="#3">click here</a>
&#13;