2
I made a responsive menu on a one page website.
The scrolling part of the page is working normally, but the menu only closes if the user clicks again on the menu icon.
I need the menu to close when the user selects one of the Nav elements.
$('.efeito-desliza').click(function () {
$('html, body').animate({
scrollTop: $($(this).attr('href')).offset().top
}, 1000);
return false;
});
<nav class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle">
<span class="sr-only">Navegação Responsiva</span>
</button>
<a href="#home" class="img-responsive efeito-desliza navbar-brand"><img class="img-responsive"
src="img/logo.png"></a>
</div>
<div id="navbarCollapse" class="menu-scroll collapse navbar-collapse menu">
<ul class="nav navbar-nav ">
<li><a class="efeito-desliza" href="#bu">SOLUÇÕES</a></li>
<li><a class="efeito-desliza" href="#div-quemsomos">QUEM SOMOS</a></li>
<li><a class="efeito-desliza" href="#depoimentos">DEPOIMENTOS</a></li>
<li><a class="efeito-desliza" href="#contato">CONTATO</a></li>
</ul>
</div>
</div>
</nav>