티스토리 뷰
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:
- Total
- Today
- Yesterday
- 김치송
- ie6과 ie7 같이 사용하기 multi ie
- eclipse plugin
- 공인구
- 아디다시
- svn
- 구글수표
- JEUS
- imagemagick
- 연도
- Java
- TinyMCE
- CSS
- trac
- 간식송
- oracle
- 한글유니코드
- 기아짤방
- java 엑셀
- tomcat
- MySQL
- ERwin
- wii wi-fi 51330
- 커플링
- Ant
- erwin Schema Generation 시 필드 순서
- 이미지리사이즈
- jQuery
- log4j
- 자블라니
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |