On 5$B7n(B14$BF|(B, $B2<8a(B2$B;~(B58$BJ,(B, Brent <writebr...@gmail.comwrote:
Quote:
I have a child page opened with a simple open() statement. I'd like to
be able to refresh the parent page and keep the current scroll
position. (If I do an "F5" refresh on IE, for instance, the page will
return to the last position it had.) Is there any "easy" way to
accomplish this?
>
I've been using
>
window.opener.location.reload();
>
but this returns the page to the top. I also tried setting up a bunch
of <a nameanchors, and scroll to these, but this scrolling places
the anchor at the top of the page, which isn't always where the scroll
was before.
>
Thanks for any pointers.
>
--Brent
Hi Brent,
Try saving the scroll position in some hidden fields before the form
gets unloaded,
like this:
document.Form1.scrollx.value = (document.all)?
document.body.scrollLeft:window.pageXOffset;
document.Form1.scrolly.value = (document.all)?
document.body.scrollTop:window.pageYOffset;
Then use
window.scrollTo(scrollx, scrolly);
after the form loads to scroll to the position you saved.
Hope that helps.
Roger