js、jquery 如何隐藏浏览器地址栏(网页优化,手机可以,ipad mini不可以,求大神指教)

<meta name="apple-mobile-web-app-capable" content="yes" /> 方法1不行
if(document.documentElement.scrollHeight <= document.documentElement.clientHeight) { 方法2 不行
bodyTag = document.getElementsByTagName('body')[0];
bodyTag.style.height = document.documentElement.clientWidth / screen.width * screen.height + 'px';
}
setTimeout(function() {
window.scrollTo(0, 1)
}, 0);

function hideAddressBar(bPad) { 方法3 也不行
// Big screen. Fixed chrome likely.
if(screen.width > 980 || screen.height > 980) return;
// Standalone (full screen webapp) mode
if(window.navigator.standalone === true) return;
// Page zoom or vertical scrollbars
if(window.innerWidth !== document.documentElement.clientWidth) {
// Sometimes one pixel too much. Compensate.
if((window.innerWidth - 1) !== document.documentElement.clientWidth) return; }
setTimeout(function() {
// Already scrolled?
if(window.pageYOffset !== 0) return;
// Perform autoscroll
window.scrollTo(0, 1);
// Reset body height and scroll
if(bodyTag !== undefined) bodyTag.style.height = window.innerHeight + 'px'; window.scrollTo(0, 0); }, 1000);
}
最新回答
语物忉灼秋

2026-01-06 06:55:20

window.addEventListener("load",function() {
  setTimeout(function(){
    window.scrollTo(0, 1);
  }, 0);
});

这种是在你浏览器内容高于浏览器的时候才会有用

if(document.documentElement.scrollHeight <= document.documentElement.clientHeight) {
bodyTag = document.getElementsByTagName('body')[0];
bodyTag.style.height = document.documentElement.clientWidth / screen.width * screen.height + 'px';
} 
这个是内容没有浏览器高的情况下

综合一下:
<script>  
            window.onload=function(){  
                if(document.documentElement.scrollHeight <= document.documentElement.clientHeight) {  
                    bodyTag = document.getElementsByTagName('body')[0];  
                    bodyTag.style.height = document.documentElement.clientWidth / screen.width * screen.height + 'px';  
                }  
                setTimeout(function() {  
                    window.scrollTo(0, 1)  
                }, 0);  
            };  
        </script>

试试看吧

青春期躁动症

2026-03-13 08:03:44

自己做一个不带菜单栏和地址栏的浏览器给用户用
用户自己设置自己的浏览器,隐藏 菜单栏和地址栏
自己写个 程序,去设置用户的浏览器

请按照一下编辑程序代码。

1234567891011121314151617181920212223242526272829303132

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><HEAD><title>
实现IE浏览器真正全屏的JS代码

</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <BODY ><input type="BUTTON" name="FullScreen" value="全屏显示" 

onClick="window.open(document.location, 'www_helpor_net', 'fullscreen')"><p>这个网页特代码实现了IE浏览器的完全全屏

</p><p style="font-size:16px; text-indent:2em; font-weight:bold;">关闭方法: 按键盘 alt+f4  不过对于火狐浏览器不能完全全仍然显示地址栏和关闭按钮。 O(∩_∩)O哈哈~</p><!--下面只是说明与程序代码无关--><div style="width:95%; height:auto; display:block; margin:0 auto; margin-top:30px; font-size:10pt; line-height:150%;">

<span>本代码由<a href="

http://www.51xuediannao.com" style="color:#F00;">
懒人建站

</a> 收集整理 我要学电脑.COM →www.51xuediannao.com </span><br><a href="

http://www.51xuediannao.com">
懒人建站</a> 
http://www.51xuediannao.com<br/><span>
我们为您提供-<a href="
http://www.51xuediannao.com">HTML+CSS
模板</a>,<a href="
http://www.51xuediannao.com">JS
代码</a>,<a href="
http://www.51xuediannao.com">
网页特效</a>,<a href="
http://www.51xuediannao.com">
导航菜单</a>,<a href="
http://www.51xuediannao.com">
焦点幻灯片<a>,<a href="
http://www.51xuediannao.com">
网页欣赏</a>和<a href="
http://www.51xuediannao.com">CSS
技巧</a>;

</span><span>懒人建站只收录实用和能提高用户体验的代码

</span><span>我们只想解放出你的部分写代码时间来思考更高层次的设计,而不是要你懒惰、拼凑。

</span></div></BODY></HTML>

璎婲

2026-03-31 00:02:40

ipad 上使用的浏览器是什么浏览器?
收起 1条折叠回答