Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How scroll to old position after refresh page?

Posted on 2003-11-11
5
Medium Priority
?
663 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: 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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…

705 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