Skip to content

Instantly share code, notes, and snippets.

@beardlessman
Created December 25, 2017 06:18
Show Gist options
  • Save beardlessman/349521a07486daea1aafd4fe05d7ab5f to your computer and use it in GitHub Desktop.
Save beardlessman/349521a07486daea1aafd4fe05d7ab5f to your computer and use it in GitHub Desktop.
options for hammerjs (fix chrome swipe bug)
options = {
touchAction: 'auto',
inputClass: Hammer.SUPPORT_POINTER_EVENTS ? Hammer.PointerEventInput : Hammer.TouchInput,
recognizers: [
[Hammer.Swipe, {
direction: Hammer.DIRECTION_HORIZONTAL
}]
]
};
let ham = new Hammer($element[0], options);
ham.on('swiperight', (event) => {
console.log(event.type);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment