移動端: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狀态。
<code>document.body.addEventListener(</code><code>'touchstart'</code><code>, </code><code>function</code> <code>() { </code><code>//...空函數即可});</code>
<code></code>
本文轉自 iampomelo 51CTO部落格,原文連結:http://blog.51cto.com/iampomelo/1918541,如需轉載請自行聯系原作者