Sometimes, we want to hide the address bar on iPhone with JavaScript.
In this article, we’ll look at how to hide the address bar on iPhone with JavaScript.
How to hide the address bar on iPhone with JavaScript?
To hide the address bar on iPhone with JavaScript, we scroll 1 pixel down.
For instance, we write
window.scrollTo(0, 1);
to call scrollTo
to scroll the browser tab or window 1 pixel down.
Conclusion
To hide the address bar on iPhone with JavaScript, we scroll 1 pixel down.