How to make 'swipeup' work in jquey way?
Opened this issue · 4 comments
littlee commented
I know how to enable vertival swipe in hammer.js way.
but if I want to use jquery.hammer.js, how can I enable vertical swipe?
mshekera commented
Well, if still interested, I "found" solution:
hammerjs/hammer.js#651
So, after reading documentation... Code below works:
$(selector).hammer()
.data('hammer')
.get('swipe')
.set({ direction: Hammer.DIRECTION_VERTICAL });
joshlasdin commented
@mshekera is there a way to set that option globally to avoid having to specify it every time? Trying to do something similar with adjusting the desired velocity.
mshekera commented
@joshlasdin I think Hammer.Swipe.prototype.velocity = 0.1;
right after including hammer.js
will work.
joshlasdin commented
Figured it out: Hammer.Swipe.prototype.defaults.velocity = 0.1;
Thanks for the help @mshekera!