300ms delay removal: using fastclick.js vs using ontouchstart

前端 未结 6 1535
温柔的废话
温柔的废话 2020-12-24 03:06

I\'m using regular jQuery and I have an event handler that looks like this:

$(\'#someID\').on({

   click: SomeFunction

}, \'.SomeClass\');
<
6条回答
  •  半阙折子戏
    2020-12-24 03:43

    You may not use FastClick.js nowadays:

    Note: As of late 2015 most mobile browsers - notably Chrome and Safari - no longer have a 300ms touch delay, so fastclick offers no benefit on newer browsers, and risks introducing bugs into your application. Consider carefully whether you really need to use it.

    (Taken from: https://github.com/ftlabs/fastclick docs)

提交回复
热议问题