I am using JQTouch for an iPhone application. JQtouch disables by default the ability to pinch and enlarge a page. For one page (containing a large image) I need to enable the pinch and zoom function. This is easy:
var viewport = $("head meta[name=viewport]"); viewport.attr('content', 'width=320, initial-scale=1, maximum-scale=10.0, minimum-scale=1, user-scalable=1');
But after the user has played with a pinch and scaling, I need to dynamically reset the scaling (scale) to the default value. I tried resetting the viewport:
viewport.attr('content', 'width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;');
After calling the above code, it cannot be increased (due to user-scaleable = 0;), but it does not change the current scale to the default value.
I'm looking for something like setScale (1) or changing the attribute like current-scale = 1
Any idea?
source share