Categories
JavaScript Answers

How to hide the address bar on iPhone with JavaScript?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *