[MooTools] Easy scroll to bottom

/ Published in: JavaScript
Save to your folder(s)

This clean little script assumes you have a simple "A-name" style jump to some cool stuff at the bottom of the page that you want people to see. ID your link "browse" and your good. Certainly you could scroll to another ID on the page if you are so inclined.

Copy this code and paste it in your HTML
  1. <!-- the scripty script -->
  3. <script type="text/javascript">
  4. window.addEvent("domready", function() {
  5. var scroll = new Fx.Scroll(window);
  6. $('browse').addEvent('click', function() {
  7. scroll.toBottom();
  8. });
  9. });
  10. </script>
  12. <!-- sample html -->
  14. <a href="javascript:void('false');" id="browse">Look at stuff below</a>

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.