Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting iPhone Swipe with jQuery

I'm simply looking for a listener that will detect the swipe of a finger on a touch device.

For example;

 if (swipe.direction == 'left' ) {
     function();
 }
like image 909
Antonio Moore Avatar asked May 15 '12 14:05

Antonio Moore


2 Answers

With jQueryMobile you can use several events, such as swipe, or even swipeleft, swiperight, tap, etc.

http://jquerymobile.com/test/docs/api/events.html

like image 121
LeonardChallis Avatar answered Sep 28 '22 07:09

LeonardChallis


You can use this jquery plugin

http://www.netcu.de/jquery-touchwipe-iphone-ipad-library

like image 23
Prasenjit Kumar Nag Avatar answered Sep 28 '22 05:09

Prasenjit Kumar Nag