title: Getting the scrollbottom using jQuery
body: <p>I have the following code which gets the amount the user has scrolled from the top and the bottom and then using these values it should hide or show the shadows.</p>
  
  <pre><code>$(document).ready(function() {
  
      if ( $(window).scrollTop() + $(window).height() &gt;= $(window).height() ) {
          $('div.shadow-bottom').show();
      }
  
      $(window).scroll(function () {
  
          if ( $(window).scrollTop() &gt;= 15 ) {
              $('div.shadow-top').show();
          } else {
              $('div.shadow-top').hide();
          }
          if ( $(window).scrollTop() + $(window).height() &gt;= $(window).height() - 15 ) {
              $('div.shadow-bottom').show();
          } else {
              $('div.shadow-bottom').hide();
          }
  
      });
  
  });
  </code></pre>
  
  <p>The top works fine, but the bottom one should be hiding when you get to the bottom of the page BUT then show again if you are 15 pixels from the bottom.</p>
  
  <p>Example: <a href="http://dev.driz.co.uk/shadow/" rel="nofollow">http://dev.driz.co.uk/shadow/</a></p>