retain scroll postion after reload page.

S

sungung

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
 
S

sven.eisenschmidt

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)
 
S

Stevo

sungung said:
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.
 
S

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top