Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make 'swipeup' work in jquey way? #33

Open
littlee opened this issue Jan 21, 2015 · 4 comments
Open

How to make 'swipeup' work in jquey way? #33

littlee opened this issue Jan 21, 2015 · 4 comments

Comments

@littlee
Copy link

littlee commented Jan 21, 2015

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
Copy link

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
Copy link

@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
Copy link

mshekera commented Mar 9, 2015

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

@joshlasdin
Copy link

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

Thanks for the help @mshekera!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants