Category Archives: iPad

How to resize/rezoom page in IPAD

This code works great on WordPress, but it can easily be adjusted.

Please see ‘initial-scale’ and ‘maximum-scale’ 😉

[js]

var $j = jQuery.noConflict();
$j(window).bind(‘orientationchange’, function(event) {
if (window.orientation == 90 || window.orientation == -90 || window.orientation == 270) {
$j(‘meta[name=”viewport”]’).attr(‘content’, ‘height=device-width,width=device-height,initial-scale=1.0,maximum-scale=1.0’);
$j(window).resize();
} else {
$j(‘meta[name=”viewport”]’).attr(‘content’, ‘height=device-height,width=device-width,initial-scale=0.8,maximum-scale=2.0’);
$j(window).resize();
}
}).trigger(‘orientationchange’);

[/js]

var $j = jQuery.noConflict();
$j(window).bind(‘orientationchange’, function(event) {
if (window.orientation == 90 || window.orientation == -90 || window.orientation == 270) {
$j(‘meta[name=”viewport”]’).attr(‘content’, ‘height=device-width,width=device-height,initial-scale=1.0,maximum-scale=1.0’);
$j(window).resize();
} else {
$j(‘meta[name=”viewport”]’).attr(‘content’, ‘height=device-height,width=device-width,initial-scale=0.8,maximum-scale=2.0’);
$j(window).resize();
}
}).trigger(‘orientationchange’);