innozg
Last Updated: February 25, 2016
·
6.485K
· mment

hide mobile safari address bar

Want to hide the address bar in mobile safari? Use that

/* iOS re-orientation fix */
if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) {
    /* iOS hides Safari address bar */
    window.addEventListener("load",function() {
        setTimeout(function() {
            window.scrollTo(0, 1);
        }, 1000);
    });
}