diff options
author | Bartek Szopka <bartek.szopka+github@gmail.com> | 2012-02-15 23:56:03 +0100 |
---|---|---|
committer | Bartek Szopka <bartek.szopka+github@gmail.com> | 2012-02-15 23:56:03 +0100 |
commit | a2f4337ec2004116b46892482de0149608d1e773 (patch) | |
tree | 81ada7461c3e8ca22cb00bdf7d6d59cfc33ffd70 | |
parent | 59e1c483bc76354b81a50efb946a527493655c5a (diff) | |
download | impress.js-a2f4337ec2004116b46892482de0149608d1e773.tar.gz |
iPad viewport now defined in script to avoid breaking mobile fallback mode
-rw-r--r-- | index.html | 2 | ||||
-rw-r--r-- | js/impress.js | 10 |
2 files changed, 11 insertions, 1 deletions
@@ -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> diff --git a/js/impress.js b/js/impress.js index 8698363..e889a74 100644 --- a/js/impress.js +++ b/js/impress.js @@ -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"; |