Calculate swipe distance in jQuery-mobile

后端 未结 3 916
[愿得一人]
[愿得一人] 2020-12-11 16:52

I hope you are well today, I am trying to calculate the swipe distance (a touch gesture) on a mobile website, how would you work out how many pixels the user has swiped acro

3条回答
  •  一向
    一向 (楼主)
    2020-12-11 17:44

    I would suggest the excellent jQuery TouchSwipe Plugin by Matt Bryson: http://labs.skinkers.com/touchSwipe/.

    It has touch & swipe events for 4 directions and 1 or 2 fingers. And it has SwipeStatus with which you can get swipe distance: http://labs.skinkers.com/touchSwipe/demo/Swipe_status.html

提交回复
热议问题