http://phonegapblog.blogspot.kr/2013/07/phonegap-galaxy-s4-handles-taps-as.html


https://groups.google.com/forum/#!msg/phonegap/eNd_eFpPY2o/unj_2-DXK-0J





ere's how I solved the onclick-problem. Possibly not the best way, but in my case it was easy to implement.


So. This link would be fired twice. We don't want that.

<div onClick="myFunction();">a bad button</div>


So, instead I changed all my links to this:

<div onClick="attemptClick('myFunction()');">a nice button</div>


And then I added this JavaScript to filter the clicks..

            var clickLock = false;

            

            function attemptClick(funcName) {

                if(!clickLock) {

                    clickLock = true;

                    setTimeout(funcName,0);

                    setTimeout('resetClickLock()',300);

                }else {

                    alert("Double tap prevented!"); //Only for debugging ofc, remove!

                }

            }

            

            function resetClickLock() {

                clickLock = false;

                alert("no more lock"); //Only for debugging ofc, remove!

            }


If anyone have a better solution, please let me know! :-)



Den torsdagen den 4:e juli 2013 kl. 13:55:45 UTC+2 skrev Tor Claesson:







Changed the JavaScript a bit, this works better..


var clickLock = false;

            

            function attemptClick(funcName) {

                if(!clickLock) {

                    clickLock = true;

                    setTimeout("queueClick("+funcName+")",100);

                    setTimeout('resetClickLock()',1000);

                }else {

                }

            }

            

            function queueClick(funcName) {

                if(!clickLock) {

                    setTimeout(funcName,0);

                }else {

                }

            }

            

            function resetClickLock() {

                clickLock = false;

            }


Den fredagen den 5:e juli 2013 kl. 14:56:20 UTC+2 skrev Tor Claesson:

Posted by [czar]
,