hammerjs/jquery.hammer.js

How to make 'swipeup' work in jquey way?

Opened this issue · 4 comments

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?

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 });

@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.

@joshlasdin I think Hammer.Swipe.prototype.velocity = 0.1; right after including hammer.js will work.

Figured it out: Hammer.Swipe.prototype.defaults.velocity = 0.1;

Thanks for the help @mshekera!