I tried your solution and it seems to work intermittently. I also
tried this approach that I found:

function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}

addLoadEvent(function() {
    alert(getCookie('position'));
    window.scrollTo(0, getCookie('position'));
})

But same thing, sometimes this works and sometimes it does not. In
firefox and safari it works flawlessly. Does iPhone's browser handle
JavaScript different?

thanks,
Alex

On Dec 21, 2:44 pm, "Aleksandr Kravets" <[EMAIL PROTECTED]> wrote:
> Thanks Wayne,
>
> I'll try it. By the way the code is 
> here:http://akravets.freezoka.com/bookmark.js
>
> On Dec 21, 2007 11:05 AM, wayne <[EMAIL PROTECTED]> wrote:
>
>
>
> > You didn't put your source fragment in the post above, but if you are
> > using scrollTo() during page onload, it will not work while the
> > browser is still showing the blue 'loading progress' bar.
>
> > To fix it, move the scrollTo call into a timer event ~100ms later than
> > your current call, then keep checking position from timer event and
> > keep redoing it until takes (i.e. the window scroll event cames in and
> > the position shows it is where you wanted it).

--~--~---------~--~----~------------~-------~--~----~
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