Load content into div without having to load page using treeview menu

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 contents in the div. I need some 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&ccedil;&atilde;o Produtos</a></li>
                <li><a href="#">Estoque Cr&iacute;tico</a></li>
                <li><a href="#">Solicita&ccedil;&atilde;o por Setor</a></li>
                <li><a href="#">Entrada dos Produtos</a></li>
                <li><a href="#">Movimenta&ccedil;&atilde;o do Estoque</a></li>
                <li><a href="#">Relat&oacute;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 type any page that I upload to load the buga menu. when you click on the menu to see the submenus it opens and closes at the same time.

    
asked by anonymous 10.12.2016 / 18:16

0 answers