-
Notifications
You must be signed in to change notification settings - Fork 303
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
does the wrapper handle enabling of pinch? #43
Comments
Well, here's a hacky method of doing this, should anyone else bump into this isuse: //on pinch, do something
var myIdContainer = $("#yourIDhere");
myIdContainer.hammer({
//this is the regular hammer(options) in the wrapper
//touchAction: 'pan-y'
});
//this is a hacky way to enable the second recognizer which is "pinch"
myIdContainer.data("hammer").recognizers[1].options.enable = true;
//now that the option is set, you can bind the "pinch" event(s)
myIdContainer.bind("pinchout", function(ev) {
//do something on pinchout
}); |
@aicm you can pass your recognizers in the options myContainer
.hammer({
recognizers: [
// RecognizerClass, [options], [recognizeWith, ...], [requireFailure, ...]
[Hammer.Pinch, { enable: true }],
[Hammer.Swipe,{ direction: Hammer.DIRECTION_HORIZONTAL }]
]
}).on('pinchout swipeleft swiperight', function(){ ... }); |
@eblin awesome! Thank you 👍 |
@eblin Thank you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there,
I was looking at the wrapper but I can't see where and how to pass the .add(pinch) to the manager. I'm also no good at JS syntax so that might be why.
The text was updated successfully, but these errors were encountered: