Solved

How scroll to old position after refresh page?

Posted on 2003-11-11
5
653 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

760 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

21 Experts available now in Live!

Get 1:1 Help Now