|
-
Sep 9th, 2008, 03:00 PM
#1
Thread Starter
Addicted Member
Vertical Scrolling On Refresh
I posted this but it never showed up in the forum. So sorry for any double-posting.
I'm using the meta refresh tag to have my page automatically refresh every 60 seconds. But each time it does so, the user is returned to the top of the page. How can I preserve the user's vertical scrolling position each time the page refreshes?
Changes are not permanent, but change is. {Neil Peart}
-
Sep 10th, 2008, 05:36 AM
#2
Re: Vertical Scrolling On Refresh
Because it's meta refresh, it's going to be a very clumsy solution that you'll have to implement for this. You'll need the user's current position on the page. You can do this in a settimeout() that keeps running every x seconds. Then, you have to store it somewhere. Because your page does a meta refresh, whatever is stored in any form field will be lost. So it means that you'll probably need to write it to a cookie. So in the settimeout, get position and write to cookie. In each page onload (javascript), read the cookie and use the scrollTo method to move the scrollbar to that position.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|