0
Good afternoon. We are developing a website for a research group of the master’s degree, I am a fellow, of the course of information systems, with little experience in web programming, who can help, out of the kindness! Using the Nav-tabs and tab-content of the bootstrap, when changing tabs, the contents of the following tab are below the contents of the previous tab, as if the other elements were stacked under the new element.
The content of tab-content is being created dynamically by the context variable of Django’s.py views.
Follows the code:
<!-- MOSTRA AS ABAS DE PROJETOS EM ANDAMENTO E CONCLUÍDO -->
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8" style="display:none;" id="abas_projetos"><!--cria 2 abas de navegação-->
<ul class="nav nav-tabs" >
<li class="active"><a data-toggle="tab" href="#aba_projetos_em_andamento" onclick="alternar_abas()">
Projetos Em Andamento</a>
</li>
<li><a data-toggle="tab" href="#aba_projetos_concluidos" onclick="alternar_abas()">
Projetos Concluídos</a>
</li>
</ul>
<div id="aba_projetos_em_andamento" class="tab-pane fade active in" > <!--cria o conteudo da aba de projetos concluidos -->
{% for pesquisa in pesquisas_andamento.all %}
<div class="tab-content" class="tabContent_projetos_em_andamento">
<h4>
<a href="#{{ pesquisa.id }}" data-toggle="collapse">
{{ pesquisa.titulo }}
</a>
</h4>
<div id="{{ pesquisa.id}}" class="collapse">
<strong>Ementa:</strong> {{ pesquisa.ementa }}
<a href=" url app_name:page_name.html "> + info </a>
</div>
</div>
{% endfor %}
</div>
<div id="aba_projetos_concluidos" class="tab-pane fade" > <!--cria o conteudo da aba de projetos concluidos -->
{% for pesquisa in pesquisas_concluidas.all %}
<div class="tab-content" class="tabContent_projetos_concluidos">
<h4>
<a href="#{{ pesquisa.id}}" data-toggle="collapse">
{{ pesquisa.titulo }}
</a>
</h4>
<div id=" {{ pesquisa.id }} " class="collapse">
<strong>Ementa:</strong> {{ pesquisa.ementa }}
</div>
</div>
{% endfor %}
</div>
</div> <!-- FECHA A DIV DAS ABAS DOS PROJETOS -->
The print of the page:
Dude I believe your problem is with regard to the "fade" between one content and another. I don’t know the dynamics or the CSS you used, but if you are using visibility or opacity 0 this error may happen, you need to set
display:none
in the contents of the first tab when displaying the contents of the second tab.– hugocsl
thank hugocsl have to resolve using the same display property, but first it was necessary to 'set' it explicitly in the tag statement! Only as soon as it was possible to manipulate this property, otherwise it becomes 'Undefined'.
– Adriel Werlich