Browse files

Merge remote-tracking branch 'origin/master' into pr-257

2 parents 2bfeece + 776371d commit 43fe1b576176231e2277c3ad8f28c94c7d278175 @matthew-andrews matthew-andrews committed Jan 26, 2015
Showing with 686 additions and 640 deletions.
  1. +15 −8
  2. +0 −1 bower.json
  3. +1 −1 component.json
  4. +667 −629 lib/fastclick.js
  5. +1 −1 package.json
  6. +2 −0 tests/160-reduced.html
@@ -37,7 +37,7 @@ Chrome 32+ on Android with `width=device-width` in the [viewport meta tag](https
Same goes for Chrome on Android (all versions) with `user-scalable=no` in the viewport meta tag. But be aware that `user-scalable=no` also disables pinch zooming, which may be an accessibility concern.
-For IE10, you can use `-ms-touch-action: none` to disable double-tap-to-zoom on certain elements (like links and buttons) as described in [this MSDN blog post](
+For IE11+, you can use `touch-action: manipulation;` to disable double-tap-to-zoom on certain elements (like links and buttons). For IE10 use `-ms-touch-action: manipulation`.
## Usage ##
@@ -52,14 +52,14 @@ The script must be loaded prior to instantiating FastClick on any element of the
To instantiate FastClick on the `body`, which is the recommended method of use:
-window.addEventListener('load', function() {
- FastClick.attach(document.body);
-}, false);
+if ('addEventListener' in document) {
+ document.addEventListener('DOMContentLoaded', function() {
+ FastClick.attach(document.body);
+ }, false);
-Don't forget to add a [shim]( for `addEventListener` if you want to support IE8 and below.
-Otherwise, if you're using jQuery:
+Or, if you're using jQuery:
$(function() {
@@ -78,13 +78,20 @@ attachFastClick(document.body);
Run `make` to build a minified version of FastClick using the Closure Compiler REST API. The minified file is saved to `build/fastclick.min.js` or you can [download a pre-minified version](
+Note: the pre-minified version is built using [our build service]( which exposes the `FastClick` object through `Origami.fastclick` and will have the Browserify/CommonJS API (see above).
+var attachFastClick = Origami.fastclick;
### AMD ###
FastClick has AMD (Asynchronous Module Definition) support. This allows it to be lazy-loaded with an AMD loader, such as [RequireJS]( Note that when using the AMD style require, the full `FastClick` object will be returned, _not_ `FastClick.attach`
var FastClick = require('fastclick');
+FastClick.attach(document.body, options);
### Package managers ###
@@ -1,6 +1,5 @@
"name": "fastclick",
- "version": "1.0.2",
"main": "lib/fastclick.js",
"ignore": [
@@ -2,7 +2,7 @@
"name": "fastclick",
"repo": "ftlabs/fastclick",
"description": "Polyfill to remove click delays on browsers with touch UIs.",
- "version": "1.0.2",
+ "version": "1.0.3",
"main": "lib/fastclick.js",
"scripts": [
Oops, something went wrong.

0 comments on commit 43fe1b5

Please sign in to comment.