title: jquery on window scroll position from top
body: <p>I'm trying to change a class based on how far from the top of the document the window is, and when it's greater then a certain value to make the switch, for some reason it's not happening, this is what I have so far:</p>
  
  <pre><code>$(window).scroll(function() {
  
      if ($('html, body').offset.top &gt; ($("#top_section").outerHeight(true) + $("#grid").outerHeight(true))) { 
          $(".nav_middle_text").removeClass("selected");
          $(".nav_middle_text").addClass("notselected");
          $("#about_link").removeClass("notselected");
          $("#about_link").addClass("selected");    
      } 
  
  });
  </code></pre>