Forum Moderators: open
I have this site inside a frame. This site is bigger then one screen, so I've made it scrollable. Also, the site is set to automatically refresh every now and then. This results in the top of the site beeing displayed, regardless of what part of the site that was displayed before the refresh. How can I store the old location so the same part of the site is displayed after the refresh? I've seen several sites that have this property, so I know it's possible to do.
regards tores
saveCookie(document.body.scrollTop+"~"+document.body.scrollLeft, "scrollPos", 1);
window.location.reload()
Then, once the page is loaded, you can retrieve the cookie, then get the individual values:
var norm=readCookie("scrollPos").split("~");
window.scroll(norm[1], norm[2]);
deleteCookie("scrollPos")