Created
September 25, 2013 01:47
-
-
Save miketaylr/6694112 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var agent=navigator.userAgent.toLowerCase(); | |
var is_iphone = (agent.indexOf('iphone')!=-1); | |
(function(){ | |
if (blackberry && navigator.userAgent.match('4.6.1')) | |
solve_blackberry_mess2(); | |
if (document.location.host.indexOf('olivier') == -1) { | |
if (is_iphone || android) { | |
var supportsOrientationChange = "onorientationchange" in window, | |
orientationEvent = supportsOrientationChange ? "orientationchange" : "resize"; | |
window.addEventListener(orientationEvent, function() { | |
if (window.orientation != 0) | |
badOrientation(); | |
else | |
goodOrientation(); | |
}, false); | |
} | |
if ((is_iphone || android) && window.orientation != 0) | |
badOrientation(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At the bottom of the html file
android
is set to true: