iPad viewport now defined in script to avoid breaking mobile fallback mode

This commit is contained in:
Bartek Szopka
2012-02-15 23:56:03 +01:00
parent 59e1c483bc
commit a2f4337ec2
2 changed files with 11 additions and 1 deletions

View File

@@ -66,7 +66,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=1024, initial-scale=0.75, user-scalable=no" />
<meta name="viewport" content="width=1024" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>impress.js | presentation tool based on the power of CSS3 transforms and transitions in modern browsers | by Bartek Szopka @bartaz</title>

View File

@@ -124,6 +124,16 @@
root.className = "";
}
// viewport updates for iPad
var meta = $("meta[name='viewport']") || document.createElement("meta");
// hardcoding these values looks pretty bad, as they kind of depend on the content
// so they should be at least configurable
meta.content = "width=1024, initial-scale=0.75, user-scalable=no";
if (meta.parentNode != document.head) {
meta.name = 'viewport';
document.head.appendChild(meta);
}
var canvas = document.createElement("div");
canvas.className = "canvas";