移動端 web 開發總結

看這個鏈接 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狀態。

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


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章