Note that there are some explanatory texts on larger screens.

plurals
  1. POtouch events not working in android phonegap webview (or even built-in browser)
    primarykey
    data
    text
    <p>I was using phonegap and needed to use 'touchstart' to speed up click response, only to realize that none of 'touchstart', 'touchmove', 'touchend' is firing but 'click'.</p> <p>I even tested a simple page in the built-in browser (7" android 4.0.3 tablet), and found it failed.</p> <p>I tested on two tablets still the same. In the following page, button2 shows only 'html_click', button3 shows only 'click':</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="content-type" content="text/html;charset=utf8"&gt; &lt;meta name="viewport" content="target-densitydpi=device-dpi, width=device-width"&gt; &lt;title&gt;Droid touch event test.&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;button id="button"&gt;touch it&lt;/button&gt; &lt;button id="button2" ontouchstart="d_('html_touchstart')" onclick="d_('html_click')"&gt;html&lt;/button&gt; &lt;button id="button3"&gt;touch 3&lt;/button&gt; &lt;div id="db"&gt;&lt;/div&gt; &lt;script&gt; function $(d){return document.getElementById(d)} function d_(m){dbo.innerHTML=dbo.innerHTML+' '+m} function ts1(e){d_('document touched')} function ts2(e){d_('button touched')} function eh(e){ d_(e.type); } var ets='touchstart',dbo=$('db'); document.addEventListener(ets,ts1,false); $('button').addEventListener(ets,ts2,false); $('button3').addEventListener(ets,eh,false); $('button3').addEventListener('touchend',eh,false); $('button3').addEventListener('click',eh,false); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Why 'touchstart isn't firing? Should I do anything to make touch events work? Or is there any other way around to make click response faster?</p> <p>I used <code>mousedown</code> event, worked but not notably fast.</p> <p><code>(new Date()).getTime()</code> difference (including some <code>innerHTML</code> change) between <code>mousedown</code> and <code>click</code> is only around 15.</p>
    singulars
    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.
 

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