I have try to solution other people did, but I still can't hide the address bar in iPhone (Safari). Here is my code.
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>
I need to always show the div (class='Nav') at the top, or is it the problem that I can't trigger scoll event?