Hide the Safari Toolbar
IPhone browser real estate is scarce.  Once a page is displayed, create additional space by hiding the Safari tool bar.Â
UseÂ
window.scrollTo(0, 1);to hide the Safari toolbar.Â
The scrollTo command can be placed into in-line javascript located near the bottom of the page…….
<script type=”text/javascript”>
window.scrollTo(0, 1);
</script>Â
Or, scrollTo can be part of a page onLoad event……
<script type=”text/javascript”>
function onloadHandler()
{
window.scrollTo(0, 1);
}
</script>
Either approach seems to work okay.
***
To see a page using this technique, point your IPhone browser towards IPhone Cafe which should display all posts and then hide the toolbar.
 ***
For more on this and other IPhone web development tips, a good resource is Estelle Weyl’s Web Development for the Iphone .
IPhone Cafe » Blog Archive » CiUI and iPhone WebApps said,
April 15, 2008 @ 8:01 pm
[…] Earlier posts on iPhone Cafe described CSS styles to create Rounded Corners on Form Input Fields and iPhone Drop Down Menus with Apple’s iPhone Safari look and feel. Another post described using window.scrollTo(0, 1) to hide the Safari toolbar. […]