title: Make overlay menu disappear on link click
body: <p>To start, this question only applies to the mobile version of the site, so you'll have to shrink your browser down to a width of less than 1000 px just to see the menu. </p>
  
  <p>On that mobile layout, I've got a button that makes an overlay with 4 links appear. There's an "X" to close the overlay, but I want it to close when the user clicks on the links, as well. So far I haven't been able to make it work. Here's the code I'm using:</p>
  
  <p><a href="https://codepen.io/dftg/pen/oZyBpq" rel="nofollow noreferrer">https://codepen.io/dftg/pen/oZyBpq</a></p>
  
  <p>this is the javascript that I'm trying to adapt to make this work: </p>
  
  <pre><code>$(document).ready(function(){
    // Add smooth scrolling to all links
    $("a").on('click', function(event) {
  
      // Make sure this.hash has a value before overriding default behavior
      if (this.hash !== "") {
        // Prevent default anchor click behavior
        event.preventDefault();
  
        // Store hash
        var hash = this.hash;
  
        // Using jQuery's animate() method to add smooth page scroll
        // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
        $('html, body').animate({
          scrollTop: $(hash).offset().top
        }, 800, function(){
  
          // Add hash (#) to URL when done scrolling (default click behavior)
          window.location.hash = hash;
        });
      } // End if
    });
  });
  
  $('#hider').click(function() {
      $('menu').addClass('hidemenu');
  });
  </code></pre>