Hide address bar in android chrome browser with scroll down gesture

久未见 提交于 2021-02-10 07:25:16

问题


I have an web app developed using jquery mobile. Initially, I was trying to fit content exactly inside viewport by assigning height to the content.

$(".ui-content").height(viewportHeight);

This worked well for me.

But now I want to hide address bar. So for doing this I added some extra pixels to viewportHeight (e.g. added 1.5px extra to viewportheight).

As height is now greater than actual device's viewport, scroll down gesture should help hide address bar.

This works on all tablets, but not on android phones in landscape mode. Portrait mode shows expected behavior.

I also tried using window.scrollTo(0,1), but this is now deprecated.

I also tried scrolling on other web pages, so it hides address bar in landscape mode too. But its not working with my web app. Can anyone suggest me what could be the problem and how to fix this issue?

Thanks.

来源:https://stackoverflow.com/questions/22378059/hide-address-bar-in-android-chrome-browser-with-scroll-down-gesture

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!