## 滾動條信息
iScroll存儲了很多有用的信息,您可以使用它們來增強您的應用。
你可能會發現有用的:
* **myScroll.x/y**,當前位置
* **myScroll.directionX/Y**,最后的方向 (-1 down/right, 0 still, 1 up/left)
* **myScroll.currentPage**,當前對齊捕獲點
下面是關于處理時間的代碼示例:
~~~
myScroll = new IScroll('#wrapper');
myScroll.on('scrollEnd', function () {
if ( this.x < -1000 ) {
// do something
}
});
~~~
The above executes some code if the?`x`?position is lower than -1000px when the scroller stops. Note that I used?`this`?instead of?`myScroll`, you can use both of course, but iScroll passes itself as?`this`context when firing custom event functions.