gpt4 book ai didi

android - 在IOS7和Android中隐藏URL地址栏

转载 作者:行者123 更新时间:2023-12-01 16:46:18 25 4
gpt4 key购买 nike

此代码已在IOS和android上运行

window.scrollTo(0,1);

但是在IOS7发行后,它不再起作用了,所以我最终使用了它。
if((window.orientation == 90 || window.orientation == -90) && window.innerHeight != window.outerHeight)

它适用于IOS 7,但不适用于android。
如何使这两个代码协同工作?还是在Android和IOS上都可以隐藏URL地址栏?谢谢。

最佳答案

目前适用于IOS7

function hideAddressBar() {
if (!window.location.hash) {
if (document.height < window.outerHeight)
document.body.style.height = (window.outerHeight + 50) + 'px';
setTimeout(function () {
window.scrollTo(0, 1);
document.body.style.height = 'auto';
}, 50);
}
}

关于android - 在IOS7和Android中隐藏URL地址栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19723180/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com