Antonio Moore
Antonio Moore

Reputation: 940

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();
 }

Upvotes: 8

Views: 14840

Answers (3)

Steve de Niese
Steve de Niese

Reputation: 984

A much nicer plugin for handling swipes ( if that's all you want ) is Touch Swipe.

I found the touchwipe to be pretty rubbish, and I always find jQueryMobile way to heavy when all you want is this functionality.

https://github.com/mattbryson/TouchSwipe-Jquery-Plugin

Upvotes: 2

LeonardChallis
LeonardChallis

Reputation: 7783

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

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

Upvotes: 4

Prasenjit Kumar Nag
Prasenjit Kumar Nag

Reputation: 13461

You can use this jquery plugin

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

Upvotes: 4

Related Questions