How to know the flick direction

97 views
Skip to first unread message

Dani Kenan

unread,
Mar 25, 2014, 2:22:41 AM3/25/14
to isc...@googlegroups.com
Hi,
We have a y-only scrolling list on a mobile device.

We would like to implement swipe to the right and to the left. Each direction has its own meaning.

We found the flick event to be fired when needed but we could not tell the direction (left or right) of the flick.

Any ideas?

10x

Steve Bohrer

unread,
Mar 31, 2014, 2:51:54 AM3/31/14
to isc...@googlegroups.com
I found similar results when I experimented briefly with this event. I think it is since I don't scroll in the x direction, the .x and .directionX values are always zero. It might be that merely setting scrollX: true, in your scroll init call would be enough to make these vars have values in the flick events. But, I went a different direction before actually testing this. (Of course, maybe you've already tried this?)

In any case, if you've not already, might be worth having your flick handler print the .x/y and .directionX/Y values to console.log() and try some swipes.

(Sorry if you've already tried all this. Not a lot of background in your question)

Steve
Reply all
Reply to author
Forward
0 new messages