O'Reilly logo

PhoneGap 3.x Mobile Application Development HOTSHOT by Kerri Shotts

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Covering Hammer.js

Native-code SDKs have amazing gesture support built in. Even complicated gestures can be recognized with surprisingly little code. But when we enter the world of JavaScript, all that disappears. Gesture support has to be detected based on touch event coordinates, and that quickly becomes very complicated. There's got to be a better way!

Enter Hammer.js.

Getting ready

To install Hammer.js for the project, visit http://eightmedia.github.io/hammer.js/ and click on the large Download button. You'll be taken to a portion of their code repository; download the hammer.min.js or hammer.js file. Whichever one you download, name it hammer.js and save it to www/js/lib. If you're using the template provided in the code package for the book ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required