Results 1 to 2 of 2

Thread: Vertical Scrolling On Refresh

  1. #1

    Thread Starter
    Addicted Member kzatu's Avatar
    Join Date
    Aug 2003
    Location
    Nevada
    Posts
    148

    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}

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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
  •  



Click Here to Expand Forum to Full Width