====== Fx.Scroll ======
Here is the [[http://docs.mootools.net/Plugins/Fx/Fx.Scroll|documentation for Fx.Scroll.js]].
Smooth scrolling is pretty easy to manage with the //Fx.Scroll// class. You can scroll elements (like a div or a paragraph that has an overflow and thus a scroll bar) or the window.
Basic syntax:
new Fx.Scroll(element, options)
The options are the same as the //[[00-fx|Fx]]// options, and the element is any DOM element or the window (that has an overflow, obviously).
var scrollExample = new Fx.Scroll($('scrollExample'));
scrollExample.start(0, 120);
var scrollExample = new Fx.Scroll($('scrollExample'));
scrollExample.toTop(); //go to the top
var scrollExample = new Fx.Scroll($('scrollExample'));
scrollExample.toBottom(); //to the bottom
There are also functions //.toRight()//, //.toLeft()//, //.scrollTo(x,y)// and //.toElement()//.
Window example:
var winScroller = new Fx.Scroll(window);
/* scroll to the top */
winScroller.toTop().chain(function (){
/* then back to here */
winScroller.toElement('fxScrollWindowExample');
});