a:hover伪类在ios移动端浏览器内触发无法取消

时间:2020-04-11 20:03:17   收藏:0   阅读:194

在iOS系统的移动设备中,需要在按钮元素或1body/html上绑定一个touchstart事件才能激活:active状态。

代码如下:

// 1. 
document.body.addEventListener(‘touchstart‘,function(){});
// 2. 或者给body添加ontouchstart
<body ontouchstart>

原文:https://www.cnblogs.com/lambertlt/p/12680535.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!