From a2f4337ec2004116b46892482de0149608d1e773 Mon Sep 17 00:00:00 2001 From: Bartek Szopka Date: Wed, 15 Feb 2012 23:56:03 +0100 Subject: [PATCH] iPad viewport now defined in script to avoid breaking mobile fallback mode --- index.html | 2 +- js/impress.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index beb26d8..3fc937f 100644 --- a/index.html +++ b/index.html @@ -66,7 +66,7 @@ - + impress.js | presentation tool based on the power of CSS3 transforms and transitions in modern browsers | by Bartek Szopka @bartaz 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";