iPhone / iPad / iPod swipe events javascript

Deadly 提交于 2019-12-03 11:04:24

问题


Im looking for (if possible) javascript libraries/plugins to provide swipe events.

However I am not after the simple detection of a swipe, for example what jqTouch provides. I wish to create behavior similar to that of the images viewer on the iPod devices. So for example you drag left or right to go to the next image. You have to drag the image over 50% of the way and let go and it will snap to the next image. If you do not drag 50% of the image, it just snaps back to the original.

Any advice appreciated. Thanks.


回答1:


I think you might be looking for something like the Carousel component in Sencha Touch (view on iPad/iPhone or Chrome/Safari). This has the behavior you want built in. [I work for Sencha]




回答2:


Here is a standalone solution for your problem:

http://swipejs.com/

The more general solution to javascript swipe events can be found here:

https://github.com/eikes/jquery.swipe-events.js



来源:https://stackoverflow.com/questions/3666775/iphone-ipad-ipod-swipe-events-javascript

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