swipe events in jQuery

旧巷老猫 提交于 2019-12-12 06:30:08

问题


I'm using the mousewheel plugin for jQuery to run some animations on mouse scroll, and I'm looking for the easiest/cleanest way to simply add swipe gestures to the existing code for use on tablets.

What is a recommended plugin/library to accomplish this? I don't think I want to load the entire jquery mobile library just for this one section, so I'm looking for a small plugin similar to the mousewheel plugin if one exists.


回答1:


swipe is not an event but rather combination of following:

1) touchstart
2) touchmove
3) touchend

you can build your algo to decide if there is "swipe" and in which direction.

read this: http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html for more info




回答2:


You don't need the entire jquery mobile, they have a pretty cool custom dowload builder where you can just select the component you want.



来源:https://stackoverflow.com/questions/12522513/swipe-events-in-jquery

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