iPhone Web Page Development

Discussion in 'Jailbreaks and iOS Hacks' started by kkachurak, Jul 19, 2007.

  1. kkachurak macrumors regular

    Joined:
    Jun 26, 2007
    Location:
    Orlando, FL
    #1
    I know the last thing anyone wants to do is carry some newbie through a bunch of information, but I really am trying to learn on my own by looking at examples and reading through resources.

    Can anyone direct me to a good site/resource that can assist me in the development of my basic iPhone apps?

    Also, if anyone can let me know what the basic javascript command is to hide the nav bar once your page loads? I've been searching all night and can't figure that out.
     
  2. kkachurak thread starter macrumors regular

    Joined:
    Jun 26, 2007
    Location:
    Orlando, FL
    #3
    Okay so in the spirit on answering my own question, I found this:

    This code gets placed in the <script> tag -->

    function hideAddressbar()
    {
    window.scrollTo(0, 1);
    }

    And this gets placed in the <body> tag -->

    onLoad="hideAddressbar()"
     
  3. cmaier macrumors G3

    Joined:
    Jul 25, 2007
    Location:
    California
    #5
    A couple of caveats:

    1) it only works if the page is long enough to scroll. You may have to do something like throw <div style="height: 30px"> </div> in to pad out the length of the page

    2) i've found that I've sometimes had to delay the scrollto until the rest of the page is drawn. This can be done with a setTimeout("hideAddressbar()",250) (you may need to modify the delay)
     

Share This Page