Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

listen to tap and dragged value and function accordingly

How should I create a custom page transition which listens to tap and swipe/drag even?.Suppose, if the page is dragged right/left (while still holding), then drag/slide the page to the value of swipe/threshold. And when the tap is released, if value is equal to or greater than the center of the page or maximum threshold, slide to the next page (link), or else slide back to its original position. Example. I would like to apply it in my jquery mobile app. An example demo would be great. Thank you.

like image 953
Kakar Avatar asked Aug 02 '15 10:08

Kakar


2 Answers

Use a JavaScript library, such as HammerJS for easy touch gesture handling. Swipe is probably what you are looking for.

like image 103
Swiffy Avatar answered Oct 30 '22 05:10

Swiffy


Also TouchSwipe jquery plugin is commendable, because it's easy to implement and provides swipe, pinch, touch and threshold events and triggers: https://github.com/mattbryson/TouchSwipe-Jquery-Plugin

like image 34
Ronny Sternecker Avatar answered Oct 30 '22 04:10

Ronny Sternecker