title: Close hamburger menu after click event
body: <p>I have a hamburger menu which is almost complete with just 1 bug/issue that I can't figure out. My nav links to different areas on the home page. So on the home page the user can click a nav link which would instantly take them down to the desired location on the page. </p>
  
  <p>My issue comes as there is no loading so once the user clicks on the nav link they are brought to the location but the dropdown menu will not close. I tried adding .hide to the JS which hides the dropdown on the click of a link but that created my new issue. </p>
  
  <p>After the user clicks one of the nav links it does hide the menu but upon clicking the menu icon again the menu will not open at all. In dev tools I see that upon clicking one of the nav links it is given the style of display:none so I feel that the issue might lie there. Thanks for the help and please let me know if any other information is needed!</p>
  
  <p>HTML:</p>
  
  <pre><code>     &lt;nav class="navbar navbar-light navbar-fixed-top"&gt;
       &lt;div class="wrapping container-fluid"&gt;
          &lt;div class="hamburger"&gt;
            &lt;div class="line"&gt;&lt;/div&gt;
            &lt;div class="line"&gt;&lt;/div&gt;
            &lt;div class="line"&gt;&lt;/div&gt;
          &lt;/div&gt;
        &lt;ul class="nav navbar-nav float-sm-right mr-0 menu"&gt;
          &lt;li class="nav-item"&gt;
            &lt;span class="sr-only"&gt;&lt;/span&gt;
          &lt;/li&gt;
          &lt;li class="nav-item"&gt;
            &lt;a class="nav-link" href="#schedule"&gt;Schedule&lt;span class="sr-only"&gt;(current)&lt;/span&gt;&lt;/a&gt;
          &lt;/li&gt;
          &lt;li class="nav-item"&gt;
            &lt;a class="nav-link" href="#workshops"&gt;Workshops&lt;/a&gt;
          &lt;/li&gt;
          &lt;li class="nav-item"&gt;
            &lt;a class="nav-link" href="#locations"&gt;Location&lt;/a&gt;
          &lt;/li&gt;
          &lt;li class="nav-item"&gt;
            &lt;a class="nav-link last-link" href="#register"&gt;Register&lt;/a&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
        &lt;a class="navbar-brand" href="#home"&gt;&lt;img class="logo" src="img/Logo.png" alt=""&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/nav&gt;
  </code></pre>
  
  <p>CSS for this menu:</p>
  
  <pre><code>.menu{
    height: 0;
    overflow: hidden;
    transition: height 0.3s;
  }
  
  .open{
    height: 295px;
  }
  
  .hamburger {
    cursor: pointer;
    padding: 15px 10px 15px 0;
    display: block;
    float: right;
    margin-top: 15px;
  }
  </code></pre>
  
  <p>JS: </p>
  
  <pre><code>$('.hamburger').on('click', function () {
  
  $('.menu').toggleClass('open');
  
  });
  
  $( '.menu a' ).on("click", function(){
  $('.menu').hide();
  });
  </code></pre>