I'm really new to HTML5 for mobile. I use jQuery Mobile for my current app and I have some problems hiding the navigation bar.
I found this site: http://m.somethingborrowedmovie.warnerbros.com/. (I do not paste this link to promote the movie.)
I was just amazed by this HTML5 site. Does anyone have any idea of the method used to hide the navigation bar?
The menu is also really well done. Is there any framework to build apps like this one?
Try the following:
Add this
meta
tag in thehead
of your HTML file:Open your site with Safari on iPhone, and use the bookmark feature to add your site to the home screen.
Go back to home screen and open the bookmarked site. The URL and status bar will be gone.
As long as you only need to work with the iPhone, you should be fine with this solution.
In addition, your sample on the warnerbros.com site uses the Sencha touch framework. You can Google it for more information or check out their demos.
The problem with all of the answers given so far is that on the something borrowed site, the Mac bar remains totally hidden when scrolling up, if you just use the scrollTo solution and then the user scrolls up, the nav bar is revealed again, it seems that the have the whole site inside of a div with scrolling on so that instead of scrolling the page it only scrolls inside the div and KEEPS the nav bar hidden. The only way to reveal the nav bar is to touch the top of the screen.
Remy Sharp has a good description of the process in his article "Doing it right: skipping the iPhone url bar":
Simple javascript document navigation to "#" will do it.
This will force the navigation bar to remove itself on load.