还是需要fastclick js吗?

时间:2017-02-15 13:06:59

标签: javascript html mobile click responsive

我的意思是:

https://github.com/ftlabs/fastclick

它仍然需要且重要吗?

我知道有些事情与某些浏览器的视口声明有关。但似乎它们是旧事物,现在其他浏览器呢?

<meta name="viewport" content="width=device-width, initial-scale=1">

1 个答案:

答案 0 :(得分:24)

This article explains in detail why and when you need fastclick.js: https://developers.google.com/web/updates/2013/12/300ms-tap-delay-gone-away

TL;DR

As of Chrome 32 (back in 2014) this delay is gone for mobile-optimised sites, without removing pinch-zooming! Firefox and IE/Edge did the same shortly afterwards, and in March 2016 a similar fix landed in iOS 9.3.

As long as your <head> includes: <meta name="viewport" content="width=device-width">, this way the browser assumes you have made the text readable on mobile so there is no need for double-click.