Detecting iPhone Swipe with jQuery

橙三吉。 提交于 2019-12-09 11:15:33

问题


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

回答1:


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

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




回答2:


You can use this jquery plugin

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




回答3:


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



来源:https://stackoverflow.com/questions/10603157/detecting-iphone-swipe-with-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!