Pinch to zoom cordova

how do you implement pinch to zoom for a cordova android project

I have a iframe in which I am loading my src and I want to implement pinch to zoom on the iframe because it is occupying the whole screen

Upvotes: 6

Views: 3159

Answers (1)

Chandra Sekhar Walajapet
Chandra Sekhar Walajapet

Reputation: 2554

To be precise you can achieve pinch to zoom in two ways

  1. If you open the image in a native container which allows zoom and pinch - the performance is far better, here you might need a Cordova plugin which can do that for you, i found https://github.com/keensoft/FullScreenImage-Cordova-Plugin but i think it only opens up the image in full screen natively but doesnt allow pinch and zoom , you can try
  2. If you dont use a plugin which means the image is shown inside the webview, for which you either write code for touch events or simply use hammer.js which allows this.

Upvotes: 1

Related Questions