Aba does not come open

2

I have 4 tabs,

I'd like to know how I can get the first tab open already ... Here is the code below:

<ul id="myTabs" class="nav nav-tabs">
    <li><a data-toggle="tab" href="#menu1">Configurar Administrador</a></li>
    <li><a data-toggle="tab" href="#menu2">Configurar Perfil</a></li>
    <li><a data-toggle="tab" href="#menu3">Alterar Senha/ Email</a></li>
    <li><a data-toggle="tab" href="#menu4">Configurar Usuário Externo</a></li>
</ul>
    
asked by anonymous 07.12.2015 / 11:45

2 answers

4

It's quite simple, what you need to do is add the active class in your li:

Example:

<ul id="myTabs" class="nav nav-tabs">
    <li class="active"><a data-toggle="tab" href="#menu1">Configurar Administrador</a></li>
    <li><a data-toggle="tab" href="#menu2">Configurar Perfil</a></li>
    <li><a data-toggle="tab" href="#menu3">Alterar Senha/ Email</a></li>
    <li><a data-toggle="tab" href="#menu4">Configurar Usuário Externo</a></li>
</ul>
    
07.12.2015 / 12:01
1

I believe you need to add class active in the tab you want to be active. You can put it in the class="active" code or put it in the load of the page.

$(document).ready(function(){

  //Ache o primeiro li tab e adicionar classe active.
  $($('#myTabs').find('li').get(0)).addClass('active');

});

See which of two paths is best for you.

    
07.12.2015 / 12:01