Reputation: 103
I have to add functionality of Pinch ZoomIn/Out effect on image using jqueryMobile Plugin, can any one help?
Thanks alot,
--Brock
Upvotes: 4
Views: 6069
Reputation: 57309
It is possible on jQuery Mobile, but you will need to use a 3rd party implementation called hammer.js.
It supports a large number of gestures like:
Example:
$('#test_el').hammer().on("pinchin", ".nested_el", function(event) {
console.log(this, event);
});
$('#test_el').hammer().on("pinchout", ".nested_el", function(event) {
console.log(this, event);
});
It works with jQuery Mobile, and that is important. But you should think of some other idea, or at least another idea for Android 2.X devices, because that platform doesn't support multitouch events.
There are also some other 3rd party implementations, like Touchy. Unfortunately, Touchy only supports pinch.
Upvotes: 6