I'm making a menu where when I click on it I send a code to a page, this page it redirects to the page that was set with that id
. Until this point it is working only that when I click on the submenu, it brings me the code of his father.
carregarPaginas();
function carregarPaginas() {
$(".subitem").click(function(e) {
e.preventDefault();
var acao = $(this).find('.acao').html();
location.href = 'includes/publicacao.php?c=' + acao;
});
$(".menuLi").click(function(e) {
e.preventDefault();
var acao = $(this).find('.acao').html();
location.href = 'includes/publicacao.php?c=' + acao;
});
};
Here comes the menu structure:
<li class="menuLi">
<div class="acao">-3</div>
<div class="desc">Servicos</div>
<div class="submenuC">
<ul class="submenu">
<li class="subitem">
<div class="acao">-4</div>
<div class="desc">Downloads</div>
</li>
<li class="subitem">
<div class="acao">-5</div>
<div class="desc">Videos</div>
</li>
</ul>
</div>
</li>