title: Scroll to Top and Scroll to Bottom in Jquery
body: <p>I tried to implement the scroller with top to bottom and bottom to top with jquery. I recently tried with percent.
  From the Top to bottom with pixel is seems ok.(Means it works) for the bottom to top is only make scroll not completely finish if i mention percentage as 100</p>
  
  <pre><code>$('#spnTop').on("click",function(){
      var percentageToScroll = 100;
      var percentage = percentageToScroll/100;
      var height = jQuery(document).height();
      var documentHeight = $(document).height();
      var scroll = $(window).scrollTop();
      alert(scroll);
      var scrollAmount = Math.round((height) * percentageToScroll/ 100)-scroll;
  
      //alert(point);
      alert(scrollAmount);
      $('html,body').animate({ scrollTop: scrollAmount }, 'slow', function () {
                            alert("reached top");    });
  
  });
  </code></pre>
  
  <p>Here is the <strong><a href="http://jsfiddle.net/4qLvC/3/" rel="nofollow">fiddle</a></strong>.
  For Example: 
  percentageToScroll is now 100 but the ending of scroll is not completely finish. (from bottom to top)
  For top to bottom is 100 then it completely scroll to bottom of the page.</p>
  
  <p>I am not sure how to make it workable.</p>
  
  <p>Thanks.</p>
  
  <p>Vicky</p>