[英]Hiding URL bar on mobile (android chrome)
I have this in the <head>
我在<head>
有这个
<meta name="viewport" content="width=device-width, initial-scale=1.0">
And this after the </head>
</head>
<script type="text/javascript">
window.onLoad = function() {
window.scrollTo(0,1);
}
</script>
I am using semantic-ui. 我正在使用语义UI。 URL bar still doesn't disappear on page load. URL栏在页面加载时仍然不会消失。 It doesn't even sometimes disappear when I scroll down. 当我向下滚动时,它有时甚至不会消失。 Why? 为什么?
Try this to hide address bar 尝试隐藏地址栏
window.addEventListener("load",function() {
setTimeout(function(){
// This hides the address bar:
window.scrollTo(0, 1);
}, 0);
});
But I received problems for iPhone 6 and some Nexus. 但是我在iPhone 6和某些Nexus上遇到了问题。
This could also be a nice approach https://github.com/scottjehl/Hide-Address-Bar/blob/master/hide-address-bar.js 这也可能是一个不错的方法https://github.com/scottjehl/Hide-Address-Bar/blob/master/hide-address-bar.js
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.