bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Tabbable nav with tabs on one page

Open krmarien opened this issue 14 years ago • 3 comments

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

krmarien avatar Apr 29 '12 08:04 krmarien

Try to give a different id for each nav

slouma2000 avatar Apr 29 '12 08:04 slouma2000

I tried to give each <ul> a different id, but it didn't change a thing

krmarien avatar Apr 29 '12 08:04 krmarien

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.

krmarien avatar May 01 '12 08:05 krmarien