title: How to close mobile menu on click for anchor links
body: <p>I need a help with mobile menu. I try to find/add some script which close menu after click on menu item. Can anybody help with.</p>
  
  <p>My page is <a href="https://www.institut-vz.si/" rel="nofollow noreferrer">https://www.institut-vz.si/</a></p>
  
  <p>So When you click on the menu link it's going to the section but the menu is still open. So I need some script it should close after clicking the menu link.</p>
  
  <p>When you click on burger menu, "style" change from display:none to display:block, and menu item get class "inView current_page_item".</p>
  
  <p>Any help please.</p>
  
  <pre><code>&lt;nav id="main-menu" class="menu-header-menu-container"&gt;
  &lt;ul class="menu menu-toggle-open" style="display: block; overflow: visible;"&gt;
      &lt;li id="menu-item-16670" class="menu-item"&gt;&lt;a href="#home"&gt;Home&lt;/a&gt;&lt;/li&gt;
      &lt;li id="menu-item-16673" class="menu-item  inView current_page_item"&gt;&lt;a href="#service"&gt;Service&lt;/a&gt;&lt;/li&gt;
      &lt;li id="menu-item-16676" class="menu-item"&gt;&lt;a href="#aboutus"&gt;About us&lt;/a&gt;&lt;/li&gt;
      &lt;li id="menu-item-16677" class="menu-item"&gt;&lt;a href="#contact"&gt;Contact&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p></p>
  
  <p>Also mobile menu have this active JS code:</p>
  
  <pre><code>//Mobile Menu
  $("#dt-menu-toggle").click(function( event ){
      event.preventDefault();
  
      var $menu = $("nav#main-menu").find("ul.menu:first");
      $menu.slideToggle(function(){
          $menu.css('overflow' , 'visible');
          $menu.toggleClass('menu-toggle-open');
      });
  
      var $right = $("nav#main-menu").find("ul.menu-right");
      if( $right.length ) {
          $right.slideToggle(function(){
              $right.css('overflow' , 'visible');
              $right.toggleClass('menu-toggle-open');
          });    
      }       
  });
  </code></pre>