title: Jquery, Remove class when width screen is 1050px
body: <p>This is the JS code i'm using:</p>
  
  <pre><code>$("document").ready(function($){
  var nav = $('#menu2');
  
  $(window).scroll(function () {
      if ($(this).scrollTop() &gt; 90) {
          nav.addClass("f-nav");
      } else {
          nav.removeClass("f-nav");
      }
  });
  </code></pre>
  
  <p>But i can't seem to get this into my code.</p>
  
  <pre><code>function checkWidth(init){
  /*If browser resized, check width again */
  if ($(window).width() &lt; 514) {
      $('html').addClass('mobile');
  }
  else {
      if (!init) {
          $('html').removeClass('mobile');
      }}}$(document).ready(function() {
  checkWidth(true);
  
  $(window).resize(function() {
      checkWidth(false);
  });
  </code></pre>
  
  <p>And what i want is that when <code>.f-nav</code> is added to <code>#menu2</code>, when the screen is <code>&lt;1050</code> the classshould be removed.</p>