<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>隐藏手机浏览器地址栏</title> <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,minimal-ui"/> <meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-touch-fullscreen" content="no"/> <style type="text/css"> body{ line-height:40px; } </style> </head> <body> 1<br/>2<br/>3<br/>4<br/>5<br/>6<br/>7<br/>8<br/>9<br/> 1<br/>2<br/>3<br/>4<br/>5<br/>6<br/>7<br/>8<br/>9<br/> 1<br/>2<br/>3<br/>4<br/>5<br/>6<br/>7<br/>8<br/>9<br/> 1<br/>2<br/>3<br/>4<br/>5<br/>6<br/>7<br/>8<br/>9<br/> <script type="text/javascript"> function hideAddressBar_ios(){ 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); }, 100); }; function hideAddressBar_android(){ var n = navigator.userAgent; if(n.match(/UCBrowser/i)){ //uc浏览器 hideAddressBar_ios(); return false; } var self = document.getElementsByTagName('body')[0]; if (self.requestFullscreen) { self.requestFullscreen(); } else if (self.mozRequestFullScreen) { self.mozRequestFullScreen(); } else if (self.webkitRequestFullScreen) { self.webkitRequestFullScreen(); } }; window.addEventListener("load",function(){ navigator.userAgent.match(/Android/i) ? hideAddressBar_android() : hideAddressBar_ios(); }); </script> </body> </html>admin管理员组文章数量:1562458
版权声明:本文标题:手机浏览器隐藏地址栏的代码 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1727473942a1116352.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论