{"action":"created","issue":{"url":"https://api.github.com/repos/hammerjs/hammer.js/issues/861","labels_url":"https://api.github.com/repos/hammerjs/hammer.js/issues/861/labels{/name}","comments_url":"https://api.github.com/repos/hammerjs/hammer.js/issues/861/comments","events_url":"https://api.github.com/repos/hammerjs/hammer.js/issues/861/events","html_url":"https://github.com/hammerjs/hammer.js/issues/861","id":113453488,"number":861,"title":"Is it bad practice to use hammer on a global element such as body?","user":{"login":"charandas","id":542168,"avatar_url":"https://avatars.githubusercontent.com/u/542168?v=3","gravatar_id":"","url":"https://api.github.com/users/charandas","html_url":"https://github.com/charandas","followers_url":"https://api.github.com/users/charandas/followers","following_url":"https://api.github.com/users/charandas/following{/other_user}","gists_url":"https://api.github.com/users/charandas/gists{/gist_id}","starred_url":"https://api.github.com/users/charandas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charandas/subscriptions","organizations_url":"https://api.github.com/users/charandas/orgs","repos_url":"https://api.github.com/users/charandas/repos","events_url":"https://api.github.com/users/charandas/events{/privacy}","received_events_url":"https://api.github.com/users/charandas/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-26T21:18:54Z","updated_at":"2015-10-27T00:43:08Z","closed_at":"2015-10-27T00:43:08Z","body":"I was going to ask in SO but thought this might be pertinent for new users to hammer.\r\n\r\nOn this [html5rocks](http://www.html5rocks.com/en/mobile/touchandmouse/) article in section 6 - <em>Keep Touch Handlers Contained, or They’ll Jank Your Scroll</em>, it is recommended to use touch handlers on restricted parts of the page, for example, it says not to have touch handlers be registered on `<body>`.\r\n\r\nI have been doing this in a production app, just so these touch gestures don't impact my app.\r\n\r\n    var hammerTime, hammerDisableEvent, events = 'transform dragleft dragright swipe swipeleft swiperight';\r\n    hammerTime = new Hammer($('body').get(0));\r\n\r\n    hammerTime.on(events, function(ev){\r\n        ev.preventDefault();\r\n    });\r\n\r\nIs this a bad practice?"},"comment":{"url":"https://api.github.com/repos/hammerjs/hammer.js/issues/comments/151326909","html_url":"https://github.com/hammerjs/hammer.js/issues/861#issuecomment-151326909","issue_url":"https://api.github.com/repos/hammerjs/hammer.js/issues/861","id":151326909,"user":{"login":"arschmitz","id":462993,"avatar_url":"https://avatars.githubusercontent.com/u/462993?v=3","gravatar_id":"","url":"https://api.github.com/users/arschmitz","html_url":"https://github.com/arschmitz","followers_url":"https://api.github.com/users/arschmitz/followers","following_url":"https://api.github.com/users/arschmitz/following{/other_user}","gists_url":"https://api.github.com/users/arschmitz/gists{/gist_id}","starred_url":"https://api.github.com/users/arschmitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arschmitz/subscriptions","organizations_url":"https://api.github.com/users/arschmitz/orgs","repos_url":"https://api.github.com/users/arschmitz/repos","events_url":"https://api.github.com/users/arschmitz/events{/privacy}","received_events_url":"https://api.github.com/users/arschmitz/received_events","type":"User","site_admin":false},"created_at":"2015-10-27T00:43:08Z","updated_at":"2015-10-27T00:43:08Z","body":"@charandas the issue tracker is for bugs for support please try SO or Slack channel. Closing this as not a bug"}}