469,923 Members | 1,633 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,923 developers. It's quick & easy.

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
Mar 14 '08 #1
3 6137
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)

Mar 14 '08 #2
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.
Mar 14 '08 #3
SAM
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.search;
if( myAnchor.indexOf('?')>=0 &&
myAnchor != '?') self.location = myAnchor.replace('?','#');
}

(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.search;
opener.location = opener.location+myAnchor;
self.close();"close </a>

--
sm
Mar 14 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Daniel | last post: by
6 posts views Thread by | last post: by
3 posts views Thread by parm | last post: by
4 posts views Thread by Woody Splawn | last post: by
5 posts views Thread by raamay | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.