[英]Change bootstrap tabs when coming from another page
I have a page with topics set in a bootstrap tabbed panel. 我在引导选项卡式面板中有一个主题设置的页面。 I want to have links to the topics from another page. 我想从另一个页面链接到主题。 Is it possible when I click to a button when I go to the tabbed page the active tab to change automatically? 当我转到选项卡式页面时,单击一个按钮时,活动选项卡会自动更改吗? ie on page2.html to click a link and go to tab2 or tab3 on page1.html 即在page2.html上单击链接并转到page1.html上的tab2或tab3
<!-- tabs -->
<div id="helptabs">
<!-- tab pills -->
<div class="wrap clearfix">
<div class="container" id="fpills">
<div class="row">
<ul class="nav nav-pills" role="tablist">
<li role="presentation" class="active"><a href="#tab1" aria-controls="device-tab" role="tab" data-toggle="tab">Topic 1</a></li><li
role="presentation"><a href="#tab2" aria-controls="faq-tab" role="tab" data-toggle="tab">Topic 2</a></li><li
role="presentation"><a href="#tab3" aria-controls="help-tab" role="tab" data-toggle="tab">Topic 3</a></li>
</ul>
</div>
</div>
</div>
<!-- tab pills END -->
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="tab1">Topic 1 comes here</div>
<div role="tabpanel" class="tab-pane" id="tab2">Topic 2 comes here</div>
<div role="tabpanel" class="tab-pane" id="tab3">Topic 3 comes here</div>
</div>
<!-- tab panes END -->
</div>
<!-- tabs -->
And on the other page it should be 在另一页上应该是
<a href="[link to page1]">Topic1</a>
<a href="[link to page1 tab2]">Topic2</a>
<a href="[link to page1 tab3]">Topic3</a>
The answer you are looking for is probably here, take a look. 您正在寻找的答案可能在这里,看看。
Bootstrap tabs opening tabs on another page 引导程序选项卡在另一页上打开选项卡
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.