Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ The first box uses `touch-action:none;` to remove the 300ms delay. The second bo

The `touch-action` css property is part of the Pointer Events spec [http://www.w3.org/TR/pointerevents/#the-touch-action-css-property](http://www.w3.org/TR/pointerevents/#the-touch-action-css-property)

Unfourtanitly not all common browsers support touch action yet ( [caniuse](http://caniuse.com/#feat=css-touch-action) ) so hammer-time works by partially polyfills this property. The only supported value is `none`, `manipulation`, or `auto`
Unfortunately not all common browsers support touch action yet ( [caniuse](http://caniuse.com/#feat=css-touch-action) ) so hammer-time works by partially polyfilling this property. The only supported value is `none`, `manipulation`, or `auto`

### Advantages...

* Size Hammer-time is very very small only 417 bytes gzipped
* Size Hammer-time is very very small: only 417 bytes gzipped
* Easy to use no special libraries or events to bind. Hammer-time just speeds up the native events so you can use your favorite event library like jQuery or just plain old `addEventListener`
* Based on real standards, Hammer-time is a polyfill so it is a complete noop on browsers which support native `touch-action`
* Avoids target mismatches between the `touchend` and `click` events
Expand All @@ -26,8 +26,8 @@ Unfourtanitly not all common browsers support touch action yet ( [caniuse](http:
* **Only works when applied directly to the style attribute on an element not to a stylesheet**
* Does not prevent scrolling or other behaviors which happen on move or double tap zoom
* You cannot set the touch-action property via `element.style[ touch-action ]` browsers that do not support touch action will ignore this
* Removing the touch-action property from an existing element is not supported, Hammer-time has no way of knowing the difference between you removing the property and it being removed as a result or browser sanitization. Instead of removing the property completely simply change it to the default value of auto
* Direct manipulation of the style property in a loop on elements with touch-action set from JavaScript ( JS animations for example ) should be avoided. Because of how browsers sanitize the style attribute when setting properties we use a mutation observe to restore the the touch action property when it is removed
* Removing the touch-action property from an existing element is not supported, Hammer-time has no way of knowing the difference between you removing the property and it being removed as a result or browser sanitization. Instead of removing the property completely, simply change it to the default value of auto
* Direct manipulation of the style property in a loop on elements with touch-action set from JavaScript ( JS animations for example ) should be avoided. Because of how browsers sanitize the style attribute when setting properties, we use a mutation observer to restore the `touch-action` property when it is removed
* To properly support IE10 you need to add both `touch-action` and `-ms-touch-action`

To read more about UI response times and how this effects user experience see [http://www.nngroup.com/articles/response-times-3-important-limits/](http://www.nngroup.com/articles/response-times-3-important-limits/)
To read more about UI response times and how this affects user experience see [http://www.nngroup.com/articles/response-times-3-important-limits/](http://www.nngroup.com/articles/response-times-3-important-limits/)