Skip to content

Instantly share code, notes, and snippets.

@charliepark
Created July 13, 2011 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charliepark/1080881 to your computer and use it in GitHub Desktop.
Save charliepark/1080881 to your computer and use it in GitHub Desktop.
Javascript to include in jQuery in order to scroll to the bottom of the webpage.
// include this in your application.js file:
jQuery.fn.scrollToBottom = function(){
var bottom = $(document.body).height();
window.scrollTo(0, bottom);
};
// and invoke it whenever you want, with this:
$().scrollToBottom();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment