Solved

How scroll to old position after refresh page?

Posted on 2003-11-11
5
654 Views
Last Modified: 2008-02-01
I have a page  including a folder tree, after I clcik on one folder, it will redraw by window.write, I hope that I can scroll to old position before redraw, what can I do?
I tried top.treeFrame.window.document.body.scrollTop, then use top.treeFrame.scrollTo(), but they ddin't work.
0
Comment
Question by:mikezang
5 Comments
 

Expert Comment

by:Dopeman
ID: 9722402
try setting an ancor in a variable
and write this into your file where you want to go
<?php

$gohere = "<a name=\"#oldposition\">oldposition</a> ";
echo $gohere;
?>

and if you reload your page call it like this:

 yourpage.htm#oldposition

to jump to the ancor
0
 
LVL 5

Author Comment

by:mikezang
ID: 9722520
You know that I can't use ancor because the page is created by javascript, i only can use javasscript method, for example, scroll and so on, can you help me?
How can I get the original scroll position ?
0
 
LVL 5

Author Comment

by:mikezang
ID: 9727737
I found a strange method to solve my problem, it is ok if I used two times as below,
top.treeFrame.window.scrollTo(0, 0);
top.treeFrame.window.scrollTo(0, topY);

But if only one time is executed, it doesn't work, can you explain to me?
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10353269
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ with points refunded

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 10386214
PAQed, with points refunded (50)

PashaMod
Community Support Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now