I would be sure that this question was asked earlier, but I could not find anything very similar (the questions were a bit similar)
The trend in mobile browsers is to hide the address bar when scrolling down, which is great, but has problems for websites that are highly dependent on the heights of the percentage-based elements, such as the responsive website I'm doing now.
The problem is that the size of the viewport changes depending on the visibility of the address bar. A value of 100% height is greater if the address bar is invisible than its size when it is visible. This leads to jerky reconfiguration of the website when scrolling. This is especially problematic in mobile Google Chrome, as the address bar returns every time you scroll up, wherever you are on the page. Many jerky reconfigurations.
I want 100% to mean 100% in terms of a browser without an address bar. Whatever the solution, this will require some Javascript, but I cannot find a way to get this information. One option that comes to mind is the height of the screen, but this means that the notification bar of the mobile OS or any other elements of the browser user interface will not be taken into account. Therefore, I assume that the first step, and the next step, is to find the most eloquent way to present this height to all percent-based height elements (I know that all this could be done through Javascript, it would be nice if I could save this minimum, although they do not perform heaps of element adjustments during resize events).
The answers are much appreciated.
source share