I don't know if this applies in your situation, but I have this
problem ALL THE TIME because the Ajax requests in the page haven't
finished loading when the scrollTo is called. I've tried putting in a
delay, but it's different on WiFi than it is on EDGE. So I tried
checking document.readyState, but that's not good enough because the
Ajax requests don't affect the overall page's readyState.

I'd also be interested in a workable solution! :)

Thanks!

Jon Brisbin
http://jbrisbin.com

On Apr 14, 9:18 pm, Jonathan <[EMAIL PROTECTED]> wrote:
> Hiding the address bar for the iPhone's safari web browser is tricky
> business.  If this line exists in my document head
>
> <link href="stylesheet.css" type="text/css" rel="stylesheet" />
>
> Then window.scrollTo(0, 1) works flawlessly to tuck the address bar
> away, but if that line is not present, regardless if stylesheet.css is
> blank, regardless if my content is much longer than either the
> portrait or landscape views of the phone, no amount of setTimeOut
> allows it to function otherwise.  Here is one of the more popular
> scripts:
>
> if (navigator.userAgent.indexOf('iPhone') != -1) {
>         addEventListener("load", function() {
>                 setTimeout(function() { window.scrollTo(0, 60); }, 0);
>         }, false);
>
> }
>
> When the page initially loads on my iPhone I see the content shift
> upwards, suggesting that the scrollTo worked, but then in the next
> instant the address bar shifts back downward.  What is the secret to
> hiding the URL bar?
>
> Jonathan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to