Note that there are some explanatory texts on larger screens.

plurals
  1. PONumber of touchmove events severely reduced on Android 2.3.3
    primarykey
    data
    text
    <p>I am currently working on the redesign of a website following the responsive design + mobile first approach.</p> <p>I am trying to detect swipe events using JS on touch-enabled devices. For this purpose, I am using the following code:</p> <pre><code>document.addEventListener ('touchstart', function(event) { //Get initial finger coords }, false); document.addEventListener ('touchmove', function(event) { //Update final finger coords }, false); document.addEventListener ('touchend', function(event) { //Compare initial and final coords, trigger swipe events if necessary }, false); </code></pre> <p>I have tested this code on an iPad 1, an iPhone 4 and several devices running Android 2.2.1, and the result when I drag my finger on the screen is what I am expecting: the <code>touchmove</code> event fires several times (it can easily rise up to a hundred when doing a long gesture).</p> <p>The problem comes when I test it on an Android 2.3.3 device (I'm using a Samsung Galaxy S2). Using its native broswer, the amount of <code>touchmove</code> events is reduced to only 1 (or rarely 2).</p> <p>Am I doing something wrong or is it supposed to behave like that? Has anybody found the same problem? I was unable to find documentation about the behaviour of <code>touchmove</code> events in this version of Andriod.</p> <p>You can test it here (using a touch-enabled device): <a href="http://jsfiddle.net/xs5BG/embedded/result/" rel="nofollow">http://jsfiddle.net/xs5BG/embedded/result/</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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