Reputation: 678
i am building a magazine android app for a client using Phonegap and eclipse. The problem comes when i am in a magazine.html page and i want users to zoom the magazine pages (saved as jpeg). I tried setting the meta tags to this but it didnt work.
meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=1, minimum-scale=1.0, maximum-scale=5.0"
I have also use the android zoom code it works but the problem is it allow zooming everything and when you zoom only text will be affected and not images. Also using this code i cant e zchoose whether i want to zoom a specific page only (magazine.html).
public class MyApp extends CordovaActivity
{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.init();
// Set by <content src="index.html" /> in config.xml
super.loadUrl(Config.getStartUrl());
//super.loadUrl("file:///android_asset/www/index.html");
settings.setBuiltInZoomControls(true);
settings.setSupportZoom(true);
}
}
I have been trying to solve this for days, any help from you guys will really appreciate :-)
Upvotes: 0
Views: 548
Reputation: 14315
Try this PinchZoom.js.
new PinchZoom($('#your-element'), options);
tapZoomFactor: The zoom factor a double tap zooms to. (default 2)
zoomOutFactor: Resizes to original size when zoom factor is below the configured value. (default 1.3)
animationDuration: The animation duration in milliseconds. (default 300)
maxZoom: The maximum zoom factor. (default 4)
minZoom: The minimum zoom factor. (default 0.5)
http://rtp-ch.github.io/pinchzoom/demo/swipe.html
http://rtp-ch.github.io/pinchzoom/
Upvotes: 0