First, I am really sorry for my poor english…
Now I doing PhoneGap development.
I use iScroll to make listview scrolling.
And I want to get the scrolling direction.
For sample, when I slide down the screen, the scroller will scroll up.When I slide up the screen, the scroller will scroll down, And how to get the scroller’s direction when it scrolling?
can anyone help?
I will be grateful!
I had the same self-question and ended up using
.dirXand.dirYproperties of the iScroll instance. Their value is always either1(left/up),0(none) or-1(right/down), which nicely evaluates totrueif the direction is on the particular axis.As I need to get the direction of a flick I use
onTouchEndevent, but the same applies toonScrollMove(and possibly other events) too.