I'm working on a web app. Most of the app has scrolling disabled, however one fullscreen panel needs to be scrollable.
The problem:
If the user is in the part of the app that's scrollable, and scrolls down, the address bar disappears. If, after the address bar disappears, the user decides to exit that panel by clicking an X on the fixed-position menu bar, then the address bar never gets triggered (because scrolling up never happens) and so the user is stuck in a scroll-disabled address-bar-less state.
My question:
Is it possible to force trigger the address bar to show in Google Chrome?
Links!
JSBin output
JSBin code
btw
Simply setting $(window).scrollTop(0) doesn't do it.
Emulating using dev tools doesn't work. You need to open it in a mobile device, in the chrome app.
Thanks!
Example below:
No scrolling allowed, address bar showing
)
Scrolling allowed, address bar showing
User scrolled, address bar hiding
Go back to scrolling-disabled div, address bar is hidden
One workaround is to use a div as a scrollable container for body content. This way the body is not scrollable, but the inner div and Chrome doesn't autohide the address bar when this inner div is scrolled:
<body style="margin:0;padding:0;width:100%;height:100%">
<div style="position:absolute;width:100%;height:100%;overflow:scroll">
Content
</div>
</body>
Scroll bar visible: http://jsbin.com/zibewepiwo
Scroll bar auto hide: http://jsbin.com/yeyapijulo
Tested in Chrome Beta 44.0.2403.63 and Chrome 43.0.2357.93 in Android 4.4.2 (Samsung Galaxy Tab 3).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With