This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Marc Krenn
Posted Jul 19 - Read on Facebook

Does anyone know how to access EventData (e.g. angle, velocityX,etc.) from hammer.js (1.1.3)?



Tisho Georgiev

Hammer extends the event object passed to event handlers with additional information in event.gesture. Here's an example:
Hammer(layer._element).on 'swipe', (event) ->
if event.gesture.direction is 'up'
... // do something on swipe up

Marc Krenn

Thanks Tisho! :)

Seems like I've figured it out on my own, however, since I've always used the timestamp EventData to test it (always returns 'undefined' instead of a number as should do according to the reference) I thought it wasn't working. My bad.

Read the entire post on Facebook