title: Do JS function if window width between 800px and 799px
body: <p>I've written this simple code to reload the page on resize when the window is between 799 and 800px but it doensn't work, does anyone know why?</p>
  
  <pre><code>    $(window).resize(function() {
    if ( $(window).width() &gt; 799 &amp;&amp; $(window).width() &lt; 800 {
      location.reload();
    } else {}
  });
  </code></pre>
  
  <p>I've also written this code to check if the width is under 800 after the page reloads to do some stuff</p>
  
  <pre><code>if ($(window).width() &lt; 800) {
    // do some stuff
  } else {}
  </code></pre>
  
  <p>I probably could also use a function which should just toggle once if the breakpoints (f.ex.: 800px) gets hitted, any ideas?</p>