Note that there are some explanatory texts on larger screens.

plurals
  1. POSwipe with jQuery Mobile 1.2, PhoneGap 2.1 and Android 4.0.4 not working properly
    text
    copied!<p>I know there are already a bzillion threads about this, but I cannot get a solution.</p> <p>Problem: Not every swipe gesture is recognized.</p> <p>Setup: Android 4.0.4, PhoneGap 2.1 and jQuery Mobile 1.2</p> <p>On a touchMove (scroll or swipe) I get (almost every time)</p> <pre><code>Miss a drag as we are waiting for WebCore's response for touch down. </code></pre> <p>The problem seems to be that my setup is not able to detect a touchstop properly.</p> <p>I using the following at the moment for swiping:</p> <pre><code>(".mainList").swipeleft(function() { $.mobile.changePage("status.html", { transition : "slide" }); console.log("swipe left!!!"); }); </code></pre> <p>and this for enabling the swipe to be triggered correctly every time:</p> <pre><code>// deactivate normal touch handling for swipe to work document.ontouchmove = function(event) { event.preventDefault(); }; </code></pre> <p>This way swiping works every time but scrolling (of course) does not work anymore. You could apply this function only for the header of a page to make the header "swipable" and the content scrollable but not swipeable correctly. But this cannot be the real solution.</p> <p>I tried the following tips I gathered from various thread:</p> <ul> <li>use the ".on" function to bind the swipe event</li> <li>bind the swipe event to a class rather than an id</li> <li>Try to detect a horizontal scroll by using "ontouchstart" and "ontouchend" This does not work as the touchend event is not triggered on every swipe.</li> <li>experiment with different values of the swipe constants like $.event.special.swipe.scrollSupressionThreshold</li> </ul> <p>As I thought maybe the setup is not show whether a swipe is a real swipe or a horizontal scroll:</p> <ul> <li>prevent horizontal scrolling via css overflow</li> <li>prevent horizontal scrolling by using a customized cordovarwebview</li> <li>use different values fo the viewport meta tag in my html to set the correct page width</li> </ul> <p>All trials except the event.preventDefault(); approach do not change the situation: only every second, third or fourth swipe gesture is recognized correctly.</p> <p>Anyone with the same problem and maybe a solution? :D Thx in advance</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload