4
I would like to make a menu appear and disappear (with fadein and fadeOut) using the same button, which in the case is a button with class ". hamburger" and I’m not sure how to do.
Ps: I would like that when clicking on one of the links in the menu, the menu also closes.
I tried to use that code :
$(".hamburger").click(function () {
$(".menu").fadeIn(200);
});
$(".hamburger, .home, .meet, .services, .work, .about, .contact").click(function () {
$(".menu").fadeOut();
});
<button class="hamburger" type="button"></button>
<nav class="menu">
<ul>
<li><a href="#inicio" class="inicio">Início</a></li>
<li><a href="#a-empresa" class="empresa">A empresa</a></li>
<li><a href="#art" class="art">ART's</a></li>
<li><a href="#servicos" class="servicos">Serviços</a></li>
<li><a href="#projetos" class="projetos">Projetos</a></li>
<li><a href="#contato" class="contato">Contato</a></li>
</ul>
</nav>