Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding jQuery Mobile Swipe Configuration variables

We've been working on an iPad app and are using jQuery Mobile to handle events like swipes (to change pages). In testing the app it became apparent the default swipe configuration variables didn't feel right. It was too sensitive to swiping when trying to scroll and vice versa.

We've played with the configuration variables but we're not sure we're understanding what each configuration variable does. We've made a graphic to help us understand how they all work together. Are we understanding this correctly or missing anything?

jQuery Mobile Swipe Configuration (in the style of Comic Sans)

like image 392
Brett DeWoody Avatar asked Jan 25 '12 21:01

Brett DeWoody


1 Answers

Not sure if this will help but jQM posted this in the blog

  • http://blog.jquerymobile.com/2011/08/03/jquery-mobile-beta-2-released/

Configurable swipe event thresholds added

There were a number of hard-coded constants in the jquery.mobile.event.js swipe code. For developers who need to tweak those constants to allow a greater vertical displacement and still register a swipe, this new feature allows them to be adjusted. Thanks to mlitwin for contributing this.

  • scrollSupressionThreshold (default: 10px) – More than this horizontal displacement, and we will suppress scrolling
  • durationThreshold (default: 1000ms) – More time than this, and it isn’t a swipe
  • horizontalDistanceThreshold (default: 30px) – Swipe horizontal displacement must be more than this.
  • verticalDistanceThreshold (default: 75px) – Swipe vertical displacement must be less than this.

Related Questions:

  • Does jQuery preserve touch events properties?
  • How to recognize touch events using jQuery in Safari for iPad? Is it possible?
  • How to get position/coordinates of a tap-event with jquery-mobile?
  • Calculate swipe distance in jQuery-mobile
like image 102
Phill Pafford Avatar answered Oct 30 '22 01:10

Phill Pafford