News for hackers. Stuff that matters.
Re:Hammer.js: Add touch gestures to your page by kitbrennan on Wednesday June 03, 2015 @06:08AM (#9651576)
MacBookPro user - not really sure what I'm supposed to be experiencing? I can click and drag the white box and it moves back to its original position, is that it? I've tried all the standard Mac touch gestures.

Is this library only for tablets?

The page that was linked is pathetically vague.

Re:Hammer.js: Add touch gestures to your page by supercoder on Wednesday June 03, 2015 @06:32AM (#9651646)
It's for mobile touch events.

OSX doesn't expose any touch events to the browser.

Re:Hammer.js: Add touch gestures to your page by mrweasel on Wednesday June 03, 2015 @06:38AM (#9651663)
I don't think it works, at all, if the OS uses the gestures. The demo page does nothing on my Mac with a trackpad.

Gestures are tricky thing to use on a web page, because you have almost zero discoverability. It works in Mac OS X, because you can choose to not use the features and slowly learn them over time, through guides in the OS. Still, even on the Mac you sometimes get surprised when you accidentally trigger a gesture.

Many have be fans an proponents of gestures since the time Opera introduced mouse gestures. Personally the swiping between workspaces on the Mac is pretty much the gesture I think works.

Re:Hammer.js: Add touch gestures to your page by LePetitDev on Friday June 05, 2015 @05:15AM (#9664573)
Hammer.js is for use on touch screens, not trackpads. I found the demo on the page to be a bit vague, too, but a much better demo in the following Codepen convinced me to use it. Plus, it has a much lighter footprint than Interact.js.

http://codepen.io/klawdyo/full/azmapQ/

On a non-touch screen, hold shift while dragging the green box to emulate pinch and rotate gestures.

Re:Hammer.js: Add touch gestures to your page by therealmarv on Wednesday June 03, 2015 @08:04AM (#9651939)
Pinch and zoom is a scroll wheel event so it is not covered by hammer.js (but possible with fetching that scroll wheel event with other methods).

Gestures are not supported by HTML5 on Laptops as far as I know.

Re:Hammer.js: Add touch gestures to your page by sirsar on Wednesday June 03, 2015 @06:18AM (#9651604)
The box displays different animations based on which type of swipe was detected. At least on Windows 7 Chrome.