本文介紹了如何在 iOS 中刪除 Safari 中的地址欄?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
window.scrollTo(0,1); 的老把戲不起作用.更糟糕的是,地址欄只移動了一點,有時會卡到一半.
Old trick with window.scrollTo(0,1); doesn't work. And even worse, the address bar moves only a bit and gets stuck halfway out sometimes.
推薦答案
這是我自己研究這個問題時發現的許多東西的組合.這是在 iOS5 上正常工作的代碼:(我知道我有點晚了,但答案就是答案,希望它可以幫助將來的人)
It is a combination of many things as I have found when researching this issue for myself. Here's the code that properly works on iOS5: (I know I'm a little late, but an answer is an answer, hopefully it can help people in the future)
<!DOCTYPE html>
<html>
<head>
<title>Hide Address Bar</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
window.addEventListener("load",function() {
setTimeout(function(){
window.scrollTo(0, 0);
}, 0);
});
</script>
<style>
body { min-height: 480px; }
</style>
</head>
<body>
<h1>Content</h1>
</body>
</html>
來源:http://24ways.org/2011/raising-the-bar-on-mobile
示例:http://jsbin.com/isenax/
這篇關于如何在 iOS 中刪除 Safari 中的地址欄?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!