title: find percentage of page height jquery
body: <p>I am trying to write code to a div telling a user how far he has scrolled down the page. Here is my code:</p>
  
  <pre><code>$(document).scroll(function(){
  
  var fullHeight = $(this).height();
  
  var currentHeight = $(this).scrollTop();
  
  var percentageOfPage = currentHeight/fullHeight;
  
  percentageOfPage = percentageOfPage.toFixed(2);
  
  var t = $("#t");
  t.html("You are " + percentageOfPage + " down this page." );
  
  
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/yak613/8hpaLek6/" rel="nofollow">fiddle</a><br>
  The code works mostly how it should: it writes out the percentage how far a user has scrolled. But it stops at about .67 or .69. Why does it do that? I want it to go all the way to 1. Also, how can I display it as a percentage, like 60%, instead of a decimal, like .6? <a href="http://sarkelliancreed.comule.com/files/stories/js/height_test" rel="nofollow">here</a> is where the page is.  </p>
  
  <p><strong>ADDITION</strong>:<br>
  How can I make it so that at the when the user reaches the bottom of the page, the message becomes: "You have reached the bottom of the page", instead of the percentage?</p>