Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Mar 2005
    Posts
    115
    Thanks
    3
    Thanked 0 Times in 0 Posts

    scroll offset position in another frame - help please!

    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!
    Last edited by pavinder; 03-16-2005 at 05:49 AM.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Give these a try

    posx=parent.gridframe.document.body.scrollLeft
    posy=parent.gridframe.document.body.scrollTop
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #3
    Regular Coder
    Join Date
    Mar 2005
    Posts
    115
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks so much....greatly appreciated - works perfectly.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •