Jquery Slide to Top and Bottom of the Page

5 years 3 months ago

Pieced together from the internet.  This code should give you that nice slide action to the bottom and top of the page.  Remember to include jquery.

Basically give your link the id "gototop" or "gotobottom"

Example: <a href="#" id="gototop" >Go To Top</a>

$(document).ready(function() {

$('html, body').animate({scrollTop:0}, 'slow');
return false;

$('html, body').animate({scrollTop:$(document).height()}, 'slow');
return false;


This tech is being used a bit on my new web app ScrollMySite.com. Check it out to automatically scroll any webpage for presentations or embedded iframes.