removing the onclick delay for webapps for android

╄→гoц情女王★ 提交于 2019-12-06 13:55:40

In your link there is someone commented about Android solution (I haven't try it):

Android has same problem with laggy onClicks. Your demo doesn’t work on Android, unless I comment out window.Touch below, so I believe that DOM property is only visible on iOS.

function NoClickDelay(el) {
this.element = el;
// if (window.Touch) not available on android
this.element.addEventListener(‘touchstart’, this, false);
}

With the above change Android gets non-laggy touch event!

We had the same problem and solved it with a slightly different approche. We were able to fix it for iPhone and Android. Clicks will be fired immediately and the delayed events will be ignored. Maybe you can use it:

https://github.com/cargomedia/jquery.touchToClick

Marcelo Amorim

touchToClick or fastclick does not work in my case.

I had a lot of code at onclick events, and I'm using Tappy actually:

onClick event in android webview too slow

<meta name="viewport" content="width=device-width, user-scalable=no">

This disables double-tap zooming, so browser does not wait to detect double-tap. No need to bother with tap events. Sadly, it works only in recent browsers.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!