开发者

How to run javascript if iPhone is not in full screen mode?

开发者 https://www.devze.com 2023-03-20 04:37 出处:网络
I\'d like to run this script, but only when iPhone is not in full screen mode. <script> if (navigator.userAgent.indexOf(\'iPhone\') != -1) {

I'd like to run this script, but only when iPhone is not in full screen mode.

<script>
if (navigator.userAgent.indexOf('iPhone') != -1) {
    addEventListener("load", function() {
        setTimeout(hideURLbar, 0);
        开发者_如何学C}, false);
    }
function hideURLbar() {
window.scrollTo(0, 1);}
</script>

So how can I do that? (Could this help?)


var hidescreen = ("standalone" in window.navigator) && !window.navigator.standalone)

if (hidescreen  && navigator.userAgent.indexOf('iPhone') != -1) {
    addEventListener("load", function() {
    setTimeout(hideURLbar, 0);
    }, false);
}
function hideURLbar() {
    window.scrollTo(0, 1);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消