Javascript: always show Chrome address bar

How to enable "always show the address bar in Chrome on a mobile device using Javascript?
In other words, do not hide when the user scrolls down .

+4
source share
1 answer

You can create div, set the height in 100%and use overflow-y:auto;.

If you copy this code and paste it into your project, you will see that this is what you are looking for.

Please use this with caution, I personally like that chrome hides the navigation bar. Also, in the future, keep in mind that if you accept an answer that does not really answer your question, no one else will let him go.

Example:

/* You NEED to set the container height */
html, body {
  height:100%;
}

/* Then override the scrollbar by a custom scrollable element: */
.customnavigation {
  height:100%;
  overflow-y:auto;
}
<div class="customnavigation">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
  <img src="http://placehold.it/150x150">
</div>
Run codeHide result
+1
source

Source: https://habr.com/ru/post/1651380/


All Articles