iPad网站全屏在Safari中

Liq*_*tal 7 fullscreen meta-tags ipad

我试图获得一个全屏运行所有页面的网站,我已经看过这里:Safari中的iPad WebApp全屏,然后我的索引页面很好地填满了屏幕,但每当我点击链接到另一个页面时,即使该页面全部使用元标记进行设置,它将铬条拉回来并且所有对齐都会消失.

必须有一种方式,或者是在后期版本中修复的safari限制.

web*_*bXL 1

你可以尝试这样的事情:

if ((navigator.userAgent.indexOf('iPad') != -1)) {
    // for standalone (app) fulscreen mode
    if (window.innerHeight == 748 || window.innerHeight == 1004) { 
        var a = document.getElementsByTagName("a");
        for (var i = 0, len = a.length; i < len; i++) {
            if (a[i].getAttribute("href");) {
                a[i].onclick = function() {
                    window.location = this.getAttribute("href");
                    return false;
                }
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)