You have to options here. The meta tag posted above really hides it so your page look likes an app. If its not a web-app, I wont do this. Instead, try this:
window.addEventListener( "load", function () {
setTimeout( function () {
window.scrollTo( 0, 1 );
}, 0 );
});
That way, the user still can scroll to the top to access the addressbar.
I see this version of that funcionality a lot. Why do you need a timeout if you give a delay of 0ms anyway? Scrolling to (0, 0) works too by the way, without cutting a row of pixels of. You might wanna check for window.scrollY... and bind to 'orientationchange' too :)
Hello everyone,
For those of you using ios Safari...I'm curious if there is a standard method for hiding the search/url bar for websites added to the home screen.
Here is an example: http://blog.mengto.com/
Access this site after adding it to the homescreen, you will notice that the url/search bar is hidden.
Any help is appreciated. Thanks
<meta name="apple-mobile-web-app-capable" content="yes" />@crocodillon
Thank you. I was hoping it could be accomplished with a simple meta tag. Awesome!
You're welcome :)
Just remember to keep in mind that hiding default behaviour isn't always the best.
You have to options here. The meta tag posted above really hides it so your page look likes an app. If its not a web-app, I wont do this. Instead, try this:
That way, the user still can scroll to the top to access the addressbar.
I see this version of that funcionality a lot. Why do you need a timeout if you give a delay of 0ms anyway? Scrolling to (0, 0) works too by the way, without cutting a row of pixels of. You might wanna check for window.scrollY... and bind to 'orientationchange' too :)