Hammer.js is a JavaScript library for adding touch gestures support to any website so that users can interact with them easier on touch devices.

It requires jQuery, only 2kb sized and supports tap, double tap, hold, drag and transform.

Hammer.js

The library is implemented pretty easily:

  • just bind Hammer.js to a container HTML element
  • every touch event performed on that element returns a callback with an array of details including:
    • event
    • position
    • touches
    • scale
    • rotation

For drag gestures, it can also return extra info like the angle, direction and distance.

Hammer.js works -almost- on all modern browsers and, to sum up, "you can touch this" : ).

WebResourcesDepot Feed