Last Updated: February 25, 2016
·
639
· jzazove

Removing Mobile Safari URL Address Bar when orientation changes


<h1>
(function() {
function s() {
var e = document.createElement("div");
e.style.height = "10001px";
document.body.appendChild(e);
setTimeout(function() {
window.scrollTo(0, 0);
document.body.removeChild(e);
}, 1);
};
function a() {
var n = navigator.userAgent;
return (
n.match(/iPhone/i) || n.match(/iPad/i))
};
s();
if (a()) {
window.addEventListener('orientationchange', function(evt) {
s();
}, false);
}
})();
</h1>
</pre>