title: Add/remove class when close to bottom of page
body: <p>I have the below jquery which is adding or removing a class when the user hits the bottom of the page. I'd like to adjust this code to implement the change when the user is close to the bottom, or perhaps when the bottom comes into viewport?</p>
  
  <p>Any help greatly appreciated!</p>
  
  <p><strong>JS</strong></p>
  
  <pre><code>// Add/remove class to/from .logo upon reaching bottom of page
  $(window).scroll(function() {
     $(".logo").removeClass("viewport-bottom");
     if($(window).scrollTop() + $(window).height() === $(document).height()) {
         //you are at bottom
         $(".logo").addClass("viewport-bottom");
     }
  });
  </code></pre>