Прокручує будь-який елемент з overflow, включаючи елемент window.
var myFx = new Fx.Scroll(element[, options]);
Параметри:
var myFx = new Fx.Scroll('myElement', { offset: { 'x': 0, 'y': 100 } }).toTop();
Миттєво прокручує вказаний Element до координат x/y.
myFx.set(x, y);
var myElement = $(document.body); var myFx = new Fx.Scroll(myElement).set(0, 0.5 * document.body.offsetHeight);
Прокручує вказаний Element до наданих координат x/y.
myFx.start(x, y);
var myElement = $(document.body); var myFx = new Fx.Scroll(myElement).start(0, 0.5 * document.body.offsetHeight);
Прокручує вказаний Element до його максимального верху.
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); });
Прокручує вказаний Element до його максимального низу.
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); });
Прокручує вказаний Element до його максимального лівого краю.
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(); });
Прокручує вказаний Element до його максимального правого краю.
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);
Прокручує вказаний Element до позиції, де знайдений переданий Element.
myFx.toElement(el);
//Scrolls the "myElement" to the top left corner of the window. var myFx = new Fx.Scroll(window).toElement('myElement');
| © Linux.ria.com, 2008-2026 |