我们一直在使用iPad应用程序,并且正在使用jQuery Mobile来处理诸如滑动之类的事件(以更改页面)。在测试应用程序,显然
default swipe configuration variables不觉得正确。当试图滚动时,它太敏感,反之亦然。
我们已经使用配置变量,但是我们不知道我们要理解每个配置变量的作用。我们已经做了一个图形来帮助我们了解它们如何共同合作。我们正确理解这一点吗?
解决方法
不知道这是否有帮助,但jQM在博客中发布了这个
> 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.
相关问题:
> 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