Javascript href指向引导导航选项卡的链接未在同一页面上激活
我已经从这里实现了psulek的解决方案:允许所有站点页面上的右侧导航部分转到具有导航选项卡的页面,并打开所选选项卡,例如,单击下面的区域搜索链接可将您带到index.html并选择/打开区域表单Javascript href指向引导导航选项卡的链接未在同一页面上激活,javascript,twitter-bootstrap,tabs,nav,Javascript,Twitter Bootstrap,Tabs,Nav,我已经从这里实现了psulek的解决方案:允许所有站点页面上的右侧导航部分转到具有导航选项卡的页面,并打开所选选项卡,例如,单击下面的区域搜索链接可将您带到index.html并选择/打开区域表单 <p><a href="index.html#airport-form" >Airport Search</a></p> <p><a href="index.html#postcode-form">Postcode
<p><a href="index.html#airport-form" >Airport Search</a></p>
<p><a href="index.html#postcode-form">Postcode Search</a></p>
<p><a href="index.html#region-form">Region Search</a></p>
除了index.html本身(带有选项卡的页面)之外,这非常有效。本页还有右侧导航部分,与上面的链接相同。如果机场搜索选项卡处于活动状态,并且您单击区域搜索链接,则URL将更改为/index.htmlregion-form,但区域选项卡不会激活。如果我手动刷新/重新加载页面,则区域选项卡被激活
如何使index.html上的rh href链接自动“工作”并激活选项卡,例如,我想在单击链接时强制重新加载index.html页面,但不确定最佳方法。这里是一个通用示例,可用于导航药丸和导航选项卡 允许任何链接也控制页面导航上的选项卡 HTML
可能重复感谢分享。非常有用。现在,我在一页中使用了3组导航选项卡,并且从上面的脚本中删除了“window.scrollTo0,0;”。我希望内容滚动到顶部。现在我也在使用一个固定的顶部菜单栏,如何向脚本添加偏移顶部和平滑动画?
<a href="#aaa" class="control-tabs">Another Link a</a>
<a href="#bbb" class="control-tabs">Another Link b</a>
<ul class="nav nav-tabs">
<li><a href="#aaa" data-toggle="tab">AAA</a></li>
<li><a href="#bbb" data-toggle="tab">BBB</a></li>
<li><a href="#ccc" data-toggle="tab">CCC</a></li>
</ul>
<div class="tab-content" id="tabs">
<div class="tab-pane" id="aaa">...Content...</div>
<div class="tab-pane" id="bbb">...Content...</div>
<div class="tab-pane" id="ccc">...Content...</div>
</div>