#5 Hide address bar (iPhone)

closed
nobody
5
2008-10-20
2008-10-19
Ben Skipper
No

This is Joe Hewitt's adjustment to hide the address bar on the iPhone and gain 17% of your initial viewport without having to scroll.

I placed it in the header of the html for browser.php, not sure if this is the best place for it.

<script type="application/x-javascript">
addEventListener("load", function()
{
setTimeout(updateLayout, 0);
}, false);
var currentWidth = 0;
function updateLayout()
{
if (window.innerWidth != currentWidth){

currentWidth = window.innerWidth;
var orient = currentWidth == 320 ? "profile" : "landscape";
document.body.setAttribute("orient", orient);
setTimeout(function()
{
window.scrollTo(0, 1);
}, 100);
}
}
setInterval(updateLayout, 400);
</script>

Discussion

  • Ben Skipper
    Ben Skipper
    2008-10-19

    w/Address Bar

     
    Attachments
  • Ben Skipper
    Ben Skipper
    2008-10-19

    w/out Address Bar

     
    Attachments
  • Ben Skipper
    Ben Skipper
    2008-10-19

    File Added: withoutAddress.jpg

     
  • matthias
    matthias
    2008-10-19

    I will place it in a JS-file, so the browser can cache it after the first time he loaded it.
    I guess this needs to be on every single page?

     
  • Ben Skipper
    Ben Skipper
    2008-10-19

    Sounds good...
    I only have it located in the browser.php and it works on every page I have visited. This is another feature you could add into the module settings as a switch on or off, if it is possible, as some people may prefer the bar to the real estate.

     
  • matthias
    matthias
    2008-10-20

    • status: open --> closed