Android 4.1+ (Javascript browser): how to disable zooming/scaling on rotation? -
here meta tag:
<meta name="viewport" content="initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,width=device-width,height=device-height,target-densitydpi=device-dpi,user-scalable=no" />
it works disable user zooming/scaling when in landscape mode. however, when starting in portrait mode, or when user rotates @ least once, zooming re-enabled.
i tried this, (1) orientationchange event doesn't fire when starting in portrait mode , (2) doesn't anyway.
addevent (window, 'orientationchange', function (evt) { var viewportmeta = document.queryselector('meta[name="viewport"]') if (viewportmeta) { viewportmeta.content = "initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,width=device-width,height=device-height,target-densitydpi=device-dpi,user-scalable=no" } })
how can disable zooming/scaling entirely on android browsers 4.1 , up?
note: issue samsung's default android browser.
this might have been fixed in 4.2.
Comments
Post a Comment