Jun
4

Scrolling to the top and bottom is very easy in mootools. Check out the code below.

window.addEvent('domready', function(){

	var myFx = new Fx.Scroll(window);

	$('bottom').addEvent('click', function(e){
		e.stop();
		myFx.toBottom();
	});

	$('top').addEvent('click', function(e){
		e.stop();
		myFx.toTop();
	});

});

Lines 5-8 lets you scroll to the bottom of the page. While lines 10-13 lets you scroll to the top of the page. Easy huh?

Note: Fx.Scroll plugin must be included. Get it at Mootools More Builder.

Check out the demo

One Comment

  • Brice Hilt
    4:26 pm on May 16th, 2012:
    1

    Great information :)

Leave a Reply

Mail will not be published.

© 2012 · Karl Sheen Blog · Sitemap · Proudly powered by Wordpress and Twitter Bootstrap · Icons by Glyphicons