Hammer.js - Easily add multi-touch to your websites

With the continued growth of mobile devices, handling touch (and multi-touch) events is no longer optional. Hammer.js is a small - dependency free - library that makes handling touch events dead simple.

You can easily add tap (touch/click), double tap, hold, drag (touchmove/mousemove), swipe, and transform (pinch) events to your website with very little code. 

var hammer = new Hammer(document.getElementById("hammertime"));
hammer.ondoubletap = function(e){
  console.log("CAN touch this!");

Oh, and if jQuery is your thing, they have a simple plugin that you can download as well.

View the demo or browse the source on GitHub.

News Films

Our little film studio focuses on telling developer-centric stories that need to be seen.

Beyond Code: Season 3 / GopherCon 2015

0:00 / 0:00