jQuery Scroll to bottom of page/iframe

Adam picture Adam · Dec 11, 2009 · Viewed 315.9k times · Source

How do I use jquery to scroll right down to the bottom of an iframe or page?

Answer

Mark Ursino picture Mark Ursino · Dec 11, 2009

If you want a nice slow animation scroll, for any anchor with href="#bottom" this will scroll you to the bottom:

$("a[href='#bottom']").click(function() {
  $("html, body").animate({ scrollTop: $(document).height() }, "slow");
  return false;
});

Feel free to change the selector.