title: JS - Window width function not working
body: <p>So I have a responsive navigation menu.
  a button is used to toggle the menu in and out. This  is working fine.</p>
  
  <p>I added an exception, where if the window exceeds a certain width, the menu closes, however this is not working at all. I can't find what is wrong with this code.</p>
  
  <p>JS:</p>
  
  <pre><code>$(document).ready(function(){
      $(".menubutton").click(function(){
          $(".respmenu-gen").toggleClass("respmenu-opn respmenu-cls");
      });
      if ($(window).width() &gt; 767) {
          $(".respmenu-gen").removeClass("respmenu-opn").addClass("respmenu-cls")
      };
  });
  </code></pre>
  
  <p>jsfiddle:
  <a href="https://jsfiddle.net/76amgsb8/" rel="nofollow">https://jsfiddle.net/76amgsb8/</a></p>
  
  <p>Thank you!</p>