Reputation: 3660
I want to capture pinch events on an image in a webpage using hammer.js (or anything else is also fine). I've got two implementations of which neither works as expected. I'm testing with Android 4.1 and chrome, but would like it to be a cross browser solution (ha! if that exists...)
The first doesn't fire the pinch events at all. http://jsfiddle.net/7EV56/9/
$elem.hammer()
.on("pinchin", function (evt)
{
//do stuff
}).on("pinchout", function (evt)
{
//do stuff
});
The second fires the pinch events perfectly, but then I can't pan/scroll anymore. http://jsfiddle.net/7EV56/8/
$elem.hammer({prevent_default:true})
.on("pinchin", function (evt)
{
//do stuff
}).on("pinchout", function (evt)
{
//do stuff
});
Upvotes: 1
Views: 2555
Reputation: 3660
Out of desperation I tried every available option in the initialisation argument and lo and behold:
transform_always_block: true
Not sure what the effect is of doing this. Hopefully it won't break several other pieces of functionality, but at least these two are now fixed.
It would be very much appreciated if anyone can still shed some light on what this actually does and why it fixed it.
Cheers
Upvotes: 4