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?
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.