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);
开发者_如何学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);
}
精彩评论