Hello, I have the following doubt, I have a system of tabs in javascript but whenever I select a tab and refresh the page it automatically goes back to the first one which is bad because I intend to put buttons that work with get, anyway I can do to keep on the same tab if you update or give a get while on the same page? follow code.
<script type="text/javascript">
$(document).ready(function(){
$("#content div:nth-child(1)").show();
$(".abas li:first div").addClass("selected");
$(".aba").click(function(){
$(".aba").removeClass("selected");
$(this).addClass("selected");
var indice = $(this).parent().index();
indice++;
$("#content div").hide();
$("#content div:nth-child("+indice+")").show();
});
$(".aba").hover(
function(){$(this).addClass("ativa")},
function(){$(this).removeClass("ativa")}
);
});
<div class="TabControl">
<div id="header">
<ul class="abas">
<li>
<div class="aba">
<span>Estatisticas</span>
</div>
</li>
<li>
<div class="aba">
<span>Slides</span>
</div>
</li>
<li>
<div class="aba">
<span>Produtos</span>
</div>
</li>
<li>
<div class="aba">
<span>Serviços</span>
</div>
</li>
<li>
<div class="aba">
<span>Usuarios</span>
</div>
</li>
<li style="float:right;"><div class="aba"><span>Alterar Senha</span></div></li>
</ul>
</div>
<div id="exit">
<ul>
<li class="exit"><a href="logoff.php">Sair</a></li>
<li><input type="text" value="Master" disabled="disabled"></li>
</ul>
</div>
<div id="content">
<div class="conteudo">
Conteúdo da aba 1
</div>
<div class="conteudo">
Conteúdo da aba 2
</div>
<div class="conteudo">
<?php include("produtos.php"); ?>
</div>
<div class="conteudo">
Conteúdo da aba 4
</div>
<div class="conteudo">
Conteúdo da aba 5
</div>
<div class="conteudo">
Conteúdo da aba 6
</div>
</div>
</div>