機能:移動中にマウスのサスペンションを切り替える


スクリプトにdocument.addEventListener("touchstart", function() {}, true);コードを追加すると、モバイルインタフェースでマウスのサスペンションをトリガーできます.
  • html
  • <div class="hover">some hover effect</div>
    
    <script>
    document.addEventListener("touchstart", function() {}, true);
    </script>
  • css
  • .hover {opacity: 0;}
    
    &:hover,
    &:focus,
    &:active .hover {opacity: 1;}