【发布时间】:2018-01-13 07:27:29
【问题描述】:
我已经尝试解决其他人所做的, 但我仍然无法隐藏 iPhone (Safari) 中的地址栏。 这是我的代码。
HTML:
<div class="Nav col-xs-12">
</div>
<div class="ScrollBack">
<div class="Banner col-xs-12">
</div>
<div class="Content col-xs-12">
</div>
</div>
CSS:
.ScrollBack{
width: 100vw;
height: 110vh;
overflow-y:scroll;
}
.Nav{
background: white;
height: 6.8vh;
}
.Banner{
background: green;
height: 39.4vh;
}
.Content{
background: blue;
height: 53.8vh;
}
Javascript:
<script>
window.addEventListener("load", function() {
window.scrollTo(0, 1);
});
</script>
我需要始终在顶部显示 div (class='Nav'), 还是我无法触发 scoll 事件的问题?
【问题讨论】:
-
我还发现了一篇有趣的文章,这里有一个可能的解决方案:menacingcloud.com/?c=iPhoneAddressBar
标签: javascript jquery html css