Removed 'maximum-scale=1.0' from meta tag. Mobile visitors should be able to zoom. Added JS fix for the iOS bug where the site will autozoom whenever the orientation is changed (see http://adactio.com/journal/4470/).

This commit is contained in:
Johan Brook 2011-07-17 17:19:19 +02:00
parent b61c4b890f
commit b63da767e8
2 changed files with 17 additions and 1 deletions

View File

@ -17,7 +17,7 @@
<!-- Mobile Specific Metas <!-- Mobile Specific Metas
================================================== --> ================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- CSS <!-- CSS
================================================== --> ================================================== -->

View File

@ -10,6 +10,22 @@
$(document).ready(function() { $(document).ready(function() {
/* Prevent iPhone and iPad to autoscale the page when rotated
(http://adactio.com/journal/4470/)
================================================================ */
if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) {
var viewportmeta = document.querySelector('meta[name="viewport"]');
if (viewportmeta) {
viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0';
document.body.addEventListener('gesturestart', function() {
viewportmeta.content = 'width=device-width, minimum-scale=0.25, maximum-scale=1.6';
}, false);
}
}
/* Tabs Activiation /* Tabs Activiation
================================================== */ ================================================== */
var tabs = $('ul.tabs'); var tabs = $('ul.tabs');