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 it.
Ps: I would like that when you click on one of the menu links, the menu closes too.
I tried to use this 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>