且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

移动端 web 开发总结

更新时间:2022-09-16 11:22:31

看这个链接 https://juejin.im/entry/58f6d9fb44d904006c121d2e


移动端:active伪类无效的解决方法:


By default, Safari Mobile does not use the :active state unless there is a touchstart event handler on the relevant element or on the <body>


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

1
document.body.addEventListener('touchstart'function () { //...空函数即可});










本文转自 iampomelo 51CTO博客,原文链接:http://blog.51cto.com/iampomelo/1918541,如需转载请自行联系原作者