retain scroll postion after reload page.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sungung

    retain scroll postion after reload page.

    Hi group,

    I want to back orginal scroll postion after reload page. Is it
    possible?
    My situation is
    call popup windows -enter data on popup -close popup -refresh
    parent page -reload data.
    As you know, scroll position will be 0,0 after reloading page. But I
    want to go the postion where user click the link for popup windows.


    Thanks,

    Sungung
  • sven.eisenschmidt@googlemail.com

    #2
    Re: retain scroll postion after reload page.

    Hi sungung,
    you can reload the page maybe with an anchor(location .hash) like #/
    page/xcoord/ycoord and
    retreive it after reloading like:

    [site] =[popup] =>[popup](close and let it refresh window.top but
    with a additional location.hash) =[site](checks for a location.hash
    like #/page/xcoord/ycoord and if is set goes to the coords)

    Comment

    • Stevo

      #3
      Re: retain scroll postion after reload page.

      sungung wrote:
      I want to back orginal scroll postion after reload page. Is it
      possible?
      My situation is
      call popup windows -enter data on popup -close popup -refresh
      parent page -reload data.
      As you know, scroll position will be 0,0 after reloading page. But I
      want to go the postion where user click the link for popup windows.
      I would save it in a session cookie.

      Comment

      • SAM

        #4
        Re: retain scroll postion after reload page.

        sungung a écrit :
        Hi group,
        >
        I want to back orginal scroll postion after reload page. Is it
        possible?
        My situation is
        call popup windows -enter data on popup -close popup -refresh
        parent page -reload data.
        As you know, scroll position will be 0,0 after reloading page. But I
        want to go the postion where user click the link for popup windows.

        file in main window :

        (JS in head)
        window.onload = function() {
        myAnchor = self.location.s earch;
        if( myAnchor.indexO f('?')>=0 &&
        myAnchor != '?') self.location = myAnchor.replac e('?','#');
        }

        (body somewhere)
        <a id="P_12" onclick="return popup('page.php '+'?'+this.id); ">blah</a>


        file in popup window :

        <a href="#"
        onclick=" var myAnchor = self.location.s earch;
        opener.location = opener.location +myAnchor;
        self.close();"c lose </a>

        --
        sm

        Comment

        Working...