简体   繁体   中英

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

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);
        }, 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);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM