Close mobile menu when scrolling

-1
<header id="header">
        <nav id="main-menu" class="navbar navbar-default navbar-fixed-top" role="banner">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Menu</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="index.html"><img src="logo.png" alt="Grupo Santiago Administradora" title="Grupo Santiago Administradora"></a>
                </div>

                <div class="collapse navbar-collapse navbar-right">
                    <ul class="nav navbar-nav">
                        <li class="scroll active"><a href="#home">HOME</a></li>
                        <li class="scroll"><a href="#features">DIFERENCIAL</a></li>
                        <li class="scroll"><a href="#services">SERVIÇOS</a></li>
                        <li class="scroll"><a href="#about">QUEM SOMOS</a></li>
                        <li class="scroll"><a href="#get-in-touch">FALE CONOSCO</a></li> 
                        <li class="scroll"> &nbsp; </li>
                        <li class="scroll"><a href="#" target="_blank"><font size="4" color="#00A85A"><strong>2&deg; Via Boleto</strong></font></a></li>
                    </ul>
                </div>
            </div><!--/.container-->
        </nav><!--/nav-->
</header><!--/header-->
    
asked by anonymous 18.04.2018 / 16:12

1 answer

0

Add the following script block so that when you click on a menu link it will collapse

$('.navbar-nav a').on('click', function(){
  $('.collapse').toggleClass('in');
});
    
18.04.2018 / 18:04