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.
One Comment
4:26 pm on May 16th, 2012:
Great information
Leave a Reply