Update JSON API
[src/app-framework-demo.git] / afm-client / bower_components / hammerjs / README.md
1 # Hammer.js 2.0.6
2
3 [![Build Status](https://travis-ci.org/hammerjs/hammer.js.svg)](https://travis-ci.org/hammerjs/hammer.js)
4
5 ## Support, Questions, and Collaboration
6
7 [![Slack Status](https://hammerjs.herokuapp.com/badge.svg)](https://hammerjs.herokuapp.com/)
8
9 ## Documentation
10
11 Visit [hammerjs.github.io](http://hammerjs.github.io) for detailed documentation.
12
13 ```js
14 // get a reference to an element
15 var stage = document.getElementById('stage');
16
17 // create a manager for that element
18 var mc = new Hammer.Manager(stage);
19
20 // create a recognizer
21 var Rotate = new Hammer.Rotate();
22
23 // add the recognizer
24 mc.add(Rotate);
25
26 // subscribe to events
27 mc.on('rotate', function(e) {
28     // do something cool
29     var rotation = Math.round(e.rotation);    
30     stage.style.transform = 'rotate('+rotation+'deg)';
31 });
32 ```
33
34
35 ## Contributing
36
37 Read the [contributing guidelines](./CONTRIBUTING.md).
38
39 For PRs.
40
41 - Use [Angular Style commit messages](https://github.com/angular/angular.js/blob/v1.4.8/CONTRIBUTING.md#commit)
42 - Rebase your PR branch when necessary
43 - If you add a feature or fix a bug, please add or fix any necessary tests.
44 - If a new feature, open a docs PR to go with.
45
46 ## Building
47
48 You can get the pre-build versions from the Hammer.js website, or do this by yourself running 
49 `npm install -g grunt-cli && npm install && grunt build`