强制地址栏在移动Chrome应用中显示 [英] Force address bar to show in mobile Chrome app

查看:221
本文介绍了强制地址栏在移动Chrome应用中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用网络应用程序。



问题:



如果用户位于应用程序可滚动的部分,并向下滚动,地址栏会消失。
如果在地址栏消失后,用户决定通过点击固定位置菜单栏上的X退出该面板,然后地址栏从不被触发(因为从不发生向上滚动),因此用户是

是否可以强制触发地址栏在Google Chrome中显示?



链接!





滚动条自动隐藏:
http://jsbin.com/yeyapijulo



在Chrome Beta 44.0中测试。 2403.63和Chrome 43.0.2357.93(Android 4.4.2(Samsung Galaxy Tab 3))。


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).

这篇关于强制地址栏在移动Chrome应用中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆