title: Calculating the distance from bottom to the current position
body: <p>I am trying to calculate the diistance from the bottom the the window to the current scroll position. I have used the following code ( <a href="http://jsfiddle.net/SKN69/2/" rel="nofollow">LIVE DEMO</a> ) :-</p>
  
  <pre><code> $(window).scroll(function(){
     var height= $(document).height() - $(document).scrollTop();
     $(".height").html(height);
   });
  </code></pre>
  
  <p>The ouput when I scroll to the bottom must be <b>0</b>. But, the output is something greater than 400. Please tell me how to fix it. Thanks in advance. Any help will be appreciated.</p>