Adam Storr
Adam Storr

Reputation: 1450

Detect Horizontal Touch Event in iOS

Is it possible to detect a horiztonal touch event in JavaScript or JQuery?

Upvotes: 0

Views: 673

Answers (3)

BenM
BenM

Reputation: 53198

Shameless self-plug > https://github.com/benmajor/jQuery-Mobile-Events

Upvotes: 0

nosarious
nosarious

Reputation: 309

If you understand how to read touch events, you can check the distance between touch start and current position. If touch end occurs before a minimum distance (your choice) then you can consider it a button click. If it is longer then you can consider it a swipe.

You can also use a directional delta to see the most likely direction intended (vertical or horizontal)

While not a complete answer, I hope this provides some clues to enhance your google-fu...

Upvotes: 0

David Dunham
David Dunham

Reputation: 8329

Do you mean a swipe? http://plugins.jquery.com/project/swipe

Upvotes: 1

Related Questions