有没有办法禁用它?我的意思是在浏览器中...当您单击具有单击功能的链接或按钮或 div 时,它会在您快速单击的地方闪烁一个灰色框。我该如何防止这种情况?
您可以为该元素的 -webkit-tap-highlight-color
property 设置透明颜色。
a {
-webkit-tap-highlight-color: transparent;
}
在 Phonegap 中使用移动 Safari,只有这样有效:
* { -webkit-backface-visibility: hidden;
-webkit-tap-highlight-color: transparent;
}
来源:iPhone WebKit CSS animations cause flicker
此外,在主面板上,启用渲染:
div.myPanelOrWhatever
{
-webkit-transform: translate3d(0, 0, 0)
}
来源:Prevent flicker on webkit-transition of webkit-transform
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-tap-highlight-color:transparent
设置为所有内容(即*
)就像一个魅力。-webkit-tap-highlight-color: rgba(0,0,0,0);
添加到目标链接的非活动状态可以解决问题。webkit-tap-highlight-color: none
not 工作。您实际上必须通过rgba(0,0,0,0)
设置透明度。