How to hide browser address bar when page height is fixed and has internal jquery scrolling

As the name says, I am developing a web application for mobile devices (rss reader). It has a list of jquery mobile lists that scrolls vertically. Page header and footer fixed.

In my application, I use html webs stroge browser. Therefore, I do not use web browsing for this purpose. I want my application to look native, so I need to hide the address bar of the browser.

I tried windows.scroll(0,1) , but this does not work for me, as I said for the browser that my page has no scroll.

thanks

+6
source share
2 answers

take a look at the phone call, it may be suitable for your needs. http://phonegap.com/ it wraps your site and makes it look like a native application and does not show the address bar.

EDIT:

try it

 $(document).ready(function() { if (navigator.userAgent.match(/Android/i)) { window.scrollTo(0,0); // reset in case prev not scrolled var nPageH = $(document).height(); var nViewH = window.outerHeight; if (nViewH > nPageH) { nViewH -= 250; $('BODY').css('height',nViewH + 'px'); } window.scrollTo(0,1); } }); 
0
source

The cheers of the body should be greater than the height of the phone in px. therefore, if ur resolution is 400x800, the height of the body tag should be more than 800, for example 850 or so.

in the ur.ready .. put document:

 window.addEventListener("load", function () { // Set a timeout... setTimeout(function () { // Hide the address bar! window.scrollTo(0, 1); }, 0); }); 
0
source

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


All Articles