a:hover伪类在ios移动端浏览器内触发无法取消
在iOS系统的移动设备中,需要在按钮元素或1body/html上绑定一个touchstart事件才能激活:active状态。
代码如下:
// 1.
document.body.addEventListener('touchstart',function(){});
// 2. 或者给body添加ontouchstart
<body ontouchstart>
有什么不同见解可以在评论区共同讨论
在iOS系统的移动设备中,需要在按钮元素或1body/html上绑定一个touchstart事件才能激活:active状态。
代码如下:
// 1.
document.body.addEventListener('touchstart',function(){});
// 2. 或者给body添加ontouchstart
<body ontouchstart>