Eliminate 300ms delay on click events in mobile Safari

后端 未结 10 2151
北恋
北恋 2020-11-28 18:34

I\'ve read that mobile Safari has a 300ms delay on click events from the time the link/button is clicked to the time the event fires. The reason for the delay is to wait to

10条回答
  •  离开以前
    2020-11-28 18:44

    I searched for an easy way without jquery and without fastclick library. This works for me:

    var keyboard = document.getElementById("keyboard");
    var buttons = keyboard.children;
    var isTouch = ("ontouchstart" in window);
    for (var i=0;i

提交回复
热议问题