
Scrolls any element with an overflow, including the window element.
var myFx = new Fx.Scroll(element[, options]);
Options:
var myFx = new Fx.Scroll('myElement', { offset: { x: 0, y: 100 } }).toTop();
Scrolls the specified Element to the x/y coordinates immediately.
myFx.set(x, y);
var myElement = $(document.body); var myFx = new Fx.Scroll(myElement).set(0, 0.5 * document.body.offsetHeight);
Scrolls the specified Element to the x/y coordinates provided.
myFx.start(x, y);
var myElement = $(document.body); var myFx = new Fx.Scroll(myElement).start(0, 0.5 * document.body.offsetHeight);
Scrolls the specified Element to its maximum top.
myFx.toTop();
//Scrolls "myElement" 200 pixels down from its top and, after 1.5 seconds, //back to the top. var myFx = new Fx.Scroll('myElement', { onComplete: function(){ this.toTop.delay(1500, this); } }).scrollTo(0, 200).chain(function(){ this.scrollTo(200, 0); });
Scrolls the specified Element to its maximum bottom.
myFx.toBottom();
//Scrolls the window to the bottom and, after one second, to the top. var myFx = new Fx.Scroll(window).toBottom().chain(function(){ this.toTop.delay(1000, this); });
Scrolls the specified Element to its maximum left.
myFx.toLeft();
//Scrolls "myElement" 200 pixels to the right and then back. var myFx = new Fx.Scroll('myElement').scrollTo(200, 0).chain(function(){ this.toLeft(); });
Scrolls the specified Element to its maximum right.
myFx.toRight();
//Scrolls "myElement" to the right edge and then to the bottom. var myFx = new Fx.Scroll('myElement', { duration: 5000, wait: false }).toRight(); myFx.toBottom.delay(2000, myFx);
Scrolls the element until the element specified is at the top/left. If an axis is specified, only scrolls along that axis.
myFx.toElement(el[, axes]);
//Scrolls the "myElement" to the top left corner of the window. var myFx = new Fx.Scroll(window).toElement('myElement'); //Scrolls the "myElement" to the top corner of the window. //Does not scroll horizontally. var myFx = new Fx.Scroll(window).toElement('myElement', 'y');
Scrolls the element until the specified element is visible along the specified axes.
myFx.toElementEdge(el[, axes]);
//Scrolls the window until "myElement" is visible, scrolling in whatever direction //is required. var myFx = new Fx.Scroll(window).toElementEdge('myElement'); //Same as above but only scrolls the window up or down. var myFx = new Fx.Scroll(window).toElementEdge('myElement', 'y');
Scrolls the element until the specified element is centered along the specified axes.
myFx.toElementCenter(el[, axes]);
//Scrolls the window until "myElement" is centered in the window, //scrolling in whatever direction is required. var myFx = new Fx.Scroll(window).toElementCenter('myElement'); //Same as above but only scrolls the window up or down. var myFx = new Fx.Scroll(window).toElementCenter('myElement', 'y');
© Linux.ria.ua, 2008-2024 |