1
Next I researched a lot here before asking this question, I have a menu that when I load the content in the div it gets bugged, it opens and closes at the same time after I load the content in the div. I need help.
Menu:
<ul class="sidebar-menu" id="menu">
<li class="header">MENU PRINCIPAL</li>
<li class="active" ><a href="painelDemandas.html" ><i class="fa fa-link"></i> <span>Visão Geral</span></a></li>
<li class="treeview">
<a href="#"><i class="fa fa-link"></i> <span>Demandas</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="#" id="demandasRecebidas" page="painelDemandas.html">Demandas Recebidas</a></li>
<li><a href="#" id="demandasEnviadas" page="painelDemandas.html">Demandas Enviadas</a></li>
<li><a href="#" id="demandasMinha" page="painelDemandas.html">Minhas Demandas</a></li>
</ul>
</li>
<li class="treeview">
<a href="#"><i class="fa fa-link"></i> <span>Cadastros</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="#" page="painelUsuario.html">Cadastrar Usuario</a></li>
<li><a href="#" page="painelSetor.html">Cadastrar Setor</a></li>
<li><a href="#" page="painelTipo.html">Cadastrar Tipo</a></li>
<li><a href="#" page="painelSubTipo.html">Cadastrar SubTipo</a></li>
</ul>
</li>
<li class="treeview">
<a href="#"><i class="fa fa-link"></i> <span>Relatórios</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="#">Termo de Entrega</a></li>
<li><a href="#">Relação Produtos</a></li>
<li><a href="#">Estoque Crítico</a></li>
<li><a href="#">Solicitação por Setor</a></li>
<li><a href="#">Entrada dos Produtos</a></li>
<li><a href="#">Movimentação do Estoque</a></li>
<li><a href="#">Relatório dos Gastos</a></li>
</ul>
</li>
<li ><a href="logout.php"><i class="fa fa-link"></i> <span>Sair do Sistema</span></a></li>
</ul>
Javascript code:
$("#menu a").click(function( e ){
e.preventDefault();
var href = $(this).attr('href');
alert(href);
if(href == 'painelDemandas.html'){
$("#conteudo").load(href);
}
});
And like any page I put to load the Buga menu. when I click on the menu to see the submenus it opens and closes at the same time.
I forgot to warn I use a datatable on the page I want to click on div, this datatable is loaded with ajax.
– Hiarley Farias