Merge pull request #1057 from csrakowski/iScrollScrollTo

Updated iScroll ScrollTo
This commit is contained in:
Diullei Gomes
2013-09-20 14:34:26 -07:00
4 changed files with 19 additions and 9 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ List of Definitions
* [iCheck](http://damirfoy.com/iCheck/) (by [Dániel Tar](https://github.com/qcz))
* [Impress.js](https://github.com/bartaz/impress.js) (by [Boris Yankov](https://github.com/borisyankov))
* [Intl](http://www.ecma-international.org/ecma-402/1.0/) (by [Jeffery Grajkowski](http://github.com/pushplay))
* [iScroll](http://cubiq.org/iscroll-4) (by [Boris Yankov](https://github.com/borisyankov))
* [iScroll](http://cubiq.org/iscroll-4) (by [Boris Yankov](https://github.com/borisyankov) and [Christiaan Rakowski](https://github.com/csrakowski))
* [jake](https://github.com/mde/jake) (by [Kon](http://phyzkit.net/))
* [Jasmine](http://pivotal.github.com/jasmine/) (by [Boris Yankov](https://github.com/borisyankov))
* [Jasmine-jQuery](https://github.com/velesin/jasmine-jquery) (by [Gregor Stamac](https://github.com/gstamac))
+4 -3
View File
@@ -1,6 +1,6 @@
// Type definitions for iScroll Lite 4.1
// Project: http://cubiq.org/iscroll-4
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions by: Boris Yankov <https://github.com/borisyankov/> and Christiaan Rakowski <https://github.com/csrakowski/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -39,8 +39,9 @@ declare class iScroll {
destroy(): void;
refresh(): void;
scrollTo(x: number, y: number, time: number, relative: boolean): void;
scrollToElement(element: string, time: number): void;
scrollTo(x: number, y: number, time?: number, relative?: boolean): void;
scrollToElement(element: string, time?: number): void;
scrollToElement(element: HTMLElement, time?: number): void;
disable(): void;
enable(): void;
stop(): void;
+8
View File
@@ -17,7 +17,15 @@ var myScroll4 = new iScroll('wrapper', {
var myScroll6 = new iScroll('wrapper', { scrollbarClass: 'myScrollbar' });
myScroll1.refresh();
myScroll1.scrollTo(0, 100);
myScroll1.scrollTo(0, 100, 200);
myScroll1.scrollTo(0, 100, 200, true);
myScroll1.scrollToElement('selectedElement');
myScroll1.scrollToElement('selectedElement', 250);
myScroll1.scrollToElement(document.getElementById('selectedElement'));
myScroll1.scrollToElement(document.getElementById('selectedElement'), 250);
var myScroll7 = new iScroll(document.getElementById('wrapper'));
var myScroll8 = new iScroll(document.getElementById('wrapper'), { scrollbarClass: 'myScrollbar' });
+6 -5
View File
@@ -1,6 +1,6 @@
// Type definitions for iScroll 4.2
// Project: http://cubiq.org/iscroll-4
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions by: Boris Yankov <https://github.com/borisyankov/> and Christiaan Rakowski <https://github.com/csrakowski/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -64,12 +64,13 @@ declare class iScroll {
destroy(): void;
refresh(): void;
scrollTo(x: number, y: number, time: number, relative: boolean): void;
scrollToElement(element: string, time: number): void;
scrollToPage(pageX: number, pageY: number, time: number): void;
scrollTo(x: number, y: number, time?: number, relative?: boolean): void;
scrollToElement(element: string, time?: number): void;
scrollToElement(element: HTMLElement, time?: number): void;
scrollToPage(pageX: number, pageY: number, time?: number): void;
disable(): void;
enable(): void;
stop(): void;
zoom(x: number, y: number, scale: number, time: number): void;
zoom(x: number, y: number, scale: number, time?: number): void;
isReady(): boolean;
}