Solved

How scroll to old position after refresh page?

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Only allow one check box 17 38
How to make google charts responsive 4 46
Html using "Or" in condition 3 24
web page freezes after ajax post 7 41
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

685 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