bootstrap
bootstrap copied to clipboard
Tabbable nav with tabs on one page
Hello,
When I place a Tabbable nav on the same page with other tabs, the active tab of the other tabs is deactivated.
The code:
<ul class="nav nav-tabs">
<li class="active">
<a href="#">Page 1</a>
</li>
<li>
<a href="#">Page 2</a>
</li>
<li>
<a href="#">Page 3</a>
</li>
</ul>
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active">
<a href="#tab1" data-toggle="tab">Section 1</a>
</li>
<li>
<a href="#tab2" data-toggle="tab">Section 2</a>
</li>
<li>
<a href="#tab3" data-toggle="tab">Section 3</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab1">
<p>I'm in Section 1.</p>
</div>
<div class="tab-pane" id="tab2">
<p>Howdy, I'm in Section 2.</p>
</div>
<div class="tab-pane" id="tab3">
<p>What up girl, this is Section 3.</p>
</div>
</div>
</div>
So the Page 1 tab is activated, but if the javascript is loaded, it is deactivated. If I remove the second part (the tabbable nav) That tab remains active.
Is there a problem with my html or is this a bug?
Thanks
Try to give a different id for each nav
I tried to give each <ul> a different id, but it didn't change a thing
I found the problem,
There was a navbar with class navbar-fixed-top and I applied scrollSpy to it and that messed up the tabs.