Tabs Jquery versus Bootstrap opening php page

Asked

Viewed 94 times

0

I am working with Jquery Tabs, after adding the proper script links and starting the tab, the use to open PHP page in tabs is very simple

    <div id="tabs">
        <ul class="nav nav-tabs">
            <li><a data-toggle="tabs" href="/aba1.php">Nível: 1</a></li>
            <li><a data-toggle="tabs" href="/aba2.php">Nível: 2</a></li>
            <li><a data-toggle="tabs" href="/aba3.php">Nível: 3</a></li>
        </ul>
    </div>

Note that I don’t even need the Divs from the tabs below because they will be created automatically by Jquery

Now with Bootstrap we have the following:

  <div class="container">
    <ul class="nav nav-tabs">
      <li><a data-toggle="tab" href="#aba1">Nivel: 1</a></li>
      <li><a data-toggle="tab" href="#aba2">Nivel: 2</a></li>
      <li><a data-toggle="tab" href="#aba3">Nivel 3</a></li>
    </ul>

    <div class="tab-content">
      <div id="aba1" class="tab-pane fade in active">
        Conteudo 1
      </div>
      <div id="aba2" class="tab-pane fade">
        Conteudo 2
      </div>
      <div id="aba3" class="tab-pane fade">
        Conteudo 3
      </div>
    </div>
  </div>

Up in Tabs Jquery I could do fixed as down in bootstrap, it would be the same procedure creating the proper DIV for each tab.

It turns out that in Jquery I can only load the contents of the tab I want when the respective tab is clicked, already in the bootstrap I did not find how to make use of link or dynamic page in each tab, I put the link in the tab but it just does not load even from the error, I would have to load all Divs content, but what if I want to do a dynamic load of div equal to Jquery how to proceed?

  • Dude since you use it in php I think putting a include in bootstrap where this "content 1" 2 and 3 would solve.

  • 1

    @hugscsl, yes it would solve, but it is not a good way to do it, because that way all the contents of the 3 tabs are loaded at once, and this content I need to reload whenever a tab is clicked, as I will load exactly the tab that was clicked, Will I have to upload the whole screen again? The content is dynamic so it has to be loaded only if clicked in the respective tab. Apparently there is this option in the tabs of bootstrap 3.7.7 I will have to make use of Jquery to load, in this case I will keep the tabs Jquery same

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.