简单的问题。我有一个DIV单击时会改变它的背景颜色。这里的HTML:Cordova 300ms延迟
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, height=device-height, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, initial-scale=1">
<script type="text/javascript" src="./js/code.js"></script>
<link rel="stylesheet" href="./css/styles.css">
<title>xxx</title>
</head>
<body onload="fInitializeFramework()">
<div onclick="fx()" class="fx">touch me!</div>
</body>
</html>
的CSS:
html {
height: 100%;
-webkit-touch-callout: none; /* Prevent callout to copy image, etc. when tap to hold */
-webkit-text-size-adjust: none; /* Prevent webkit from resizing text to fit */
-webkit-tap-highlight-color: rgba(0,0,0,0); /* Prevent tap highlight color/shadow */
-webkit-user-select: none; /* No element selection */
cursor: default; /* Default cursor */
touch-action: manipulation; /* Disable double tap to zoom */
}
.fx:active {
background: yellow;
}
和JavaScript:
function fInitializeFramework()
{
document.addEventListener("deviceready",fRun);
return;
}
function fRun()
{
return;
}
function fx()
{
return;
}
在Chrome在桌面上,一切都很好,迅速引发Click事件。但是,一旦变成与科尔多瓦,平板电脑或手机上的apk,DIV上的触摸和其背景颜色的变化之间存在延迟。
它看起来像臭名昭着的300毫秒延迟。然而,我也跟着被推荐的一切:
- 视口元与宽度=设备宽度和最小规模= 1.0,最大规模= 1.0
- 触摸动作:操纵, 等
我试着用fasclick.js,没有结果。这是正常的,因为它在文档中提到的铬32+是没用的。
我怀疑:活性所以我试图改变背景处理用JavaScript,而不是在使用HTML的onclick的onclick()事件。同样的结果,平板电脑上的延迟。
Android是6.0。科尔多瓦7.0.1。
有什么想法?