By default, Safari Mobile does not use the :active state unless there is a
touchstart event handler on the relevant element or on the
ontouchstart
空方法(页面首个元素起作用)<body ontouchstart=""></body>
document.addEventListener("touchstart", function() {},false);
// 或
document.body.addEventListener("touchstart", function() {})
添加如下css配合
html {
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
<a ontouchstart="">Click me</a>
var a=document.getElementsByTagName(‘a’);
for(var i=0;i<a.length;i++){
a[i].addEventListener(‘touchstart’,function(){},false);
}
原文:https://www.cnblogs.com/GManba/p/13205514.html