Hammer.js supports quite a few gestures too:
- Double Tap
- Transform (Pinching)
Of course, what would touch events be without the actual Event data? When a user interacts with the screen, Hammer.js reports back to you with all of the information related to the touch. You can find out how long somebody touched the screen, where they touched, which direction they were swiping or dragging, the momentum of the swipe, and so on
So, why would you want use Hammer.js in your projects?
Sure, there are other libraries out there that handle gestures, but it’s important to think about resources when creating mobile apps. Hammer.js runs about 2kb (minified) and leaves a very tiny footprint.
Simple to use
The syntax is incredibly easy to both use and understand. There’s even a jQuery plugin available if you’re like me and like to take shortcuts in your code.
Plays nice with others
Hammer.js works well alongside other libraries and frameworks. Whether you’re using jQuery, bbUI.js, Backbone.js, or others, you should have no worries that Hammer.js will interfere. It performs very well, and doesn’t get in the way.
Check out my sample app!
I worked very hard for what seemed like minutes, creating an awesome sample app to show how easy it is to use the Hammer.js library. Check it out in our GitHub repo – there’s even a special appearance by the one-and-only Jesse Ariss!
If you have any questions, or comments, feel free to hit me up on Twitter. I like the attention. @chadtatro