Skip to content

Repository files navigation

Gesture

Emitter wrapper and a little sugar on top of Hammer.js.

Installation

$ component install component/gesture

Events

  • drag start
  • drag
  • drag end
  • tap
  • double tap
  • hold
  • release
  • transform start
  • transform
  • transform end
  • swipe
  • swipe left
  • swipe right
  • swipe up
  • swipe down

API

gesture(el)

Bind gestures to the given el and returns a Gesture.

vargesture=require('gesture');varimg=document.getElementById('maru');varmaru=gesture(img);maru.on('transform',function(e){varr=e.rotation.toFixed(2);vars=e.scale.toFixed(2);img.style['-webkit-transform']='rotate('+r+'deg) scale('+s+')';});setTimeout(function(){maru.unbind();},5000);

Gesture#unbind()

Unbind event handlers.

License

MIT

About

Multi-touch gesture sugar layer on top of hammer.js

Resources

Stars

16 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages