View Full Version : scroll offset position in another frame - help please!

03-16-2005, 05:45 AM
Hello, wonder if anyone could help....I have a page with a navigation frame (id="navi") and main frame (id="gridframe"). The pages displayed in the main frame are very large grids.

When I load a new page into this main frame I want to scroll it to the same grid position at which the previous page had been. I also want to ensure cross-browser compatibility.

I've searched and found how to use the scrollTo command to position a new page, but what I cannot find is a javascript instruction to retrieve the Xoffset and Yoffset of the original page when it is in a different frame to the navigation.

I've tried various combinations including:
xpos = parent.gridframe.document.body.pageXOffset
xpos = parent.gridframe.pageXoffset
xpos = parent.document.gridframe.body.scrollLeft

but nothing seems to be working. Any help would be most appreciated!

Mr J
03-16-2005, 03:18 PM
Give these a try


03-16-2005, 04:02 PM
Thanks so much....greatly appreciated - works perfectly.