【问题标题】:How to hide the address bar on a mobile web such as chrome or android browser?如何隐藏移动网页(如 chrome 或 android 浏览器)上的地址栏?
【发布时间】:2012-10-26 08:12:02
【问题描述】:

当用户输入 URL 时,我正在尝试在 android 设备上使 videojs 全屏显示。 但是,地址栏仍然存在。怎么隐藏?

【问题讨论】:

    标签: javascript android html html5-video


    【解决方案1】:

    试试这个...

    if(navigator.userAgent.match(/Android/i)){
        window.scrollTo(0,1);
    }
    

    这显然必须在加载时完成,请参阅http://atlchris.com/1847/quick-tip-hide-mobile-web-browser-address-bar-improved/

    【讨论】:

    • 我发现这是一种很好的方法,可以点击任何适用于该技巧的浏览器: if( window.scrollY == 0 && window.scrollX == 0 ) window.scrollTo(0, 0);
    猜你喜欢
    • 2013-07-21
    • 2020-01-21
    • 1970-01-01
    • 2012-08-15
    • 1970-01-01
    • 2016-10-28
    • 2013-08-06
    • 1970-01-01
    相关资源
    最近更新 更多