scroll help

M

matt shudy

Hi,

I have a page that refreshes every 5 seconds... The
problem is that if the user has scrolled down the page
before the page refreshes, when the page refreshes the
page starts at the top again. I would like to add some
java script or asp code that would remember where the page
was before the refresh and keeps it there. Is this
possible, if so, could you please provide some help.

Thanks,

Matt Shudy
 
J

Jim Buyens

-----Original Message-----
Hi,
Howdy.

I have a page that refreshes every 5 seconds... The
problem is that if the user has scrolled down the page
before the page refreshes, when the page refreshes the
page starts at the top again. I would like to add some
java script or asp code that would remember where the
page was before the refresh and keeps it there. Is this
possible, if so, could you please provide some help.

This would be fairly difficult. When your timer fires,
you would have to detect the window's current scroll
position, then either append it to the request or save it
as a cookie.

If you append the scroll position to the request, some
code on the Web server would have to include it in a
script that positioned the page on load.

If you write the scroll position to a cookie, some code
in the new page would have to retrieve the cookie and
scroll the window.

Either way, the result won't be smooth. The display will
visibly jump to the top and then scroll down.

If the amount of data is fairly small, I would consider
making the server generate an image on the fly. Then, you
can just reload the image, much as you would for a
rollover.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
|| Microsoft FrontPage Version 2002 Inside Out
|| Web Database Development Step by Step .NET Edition
|| Troubleshooting Microsoft FrontPage 2002
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
S

Stefan B Rusynko

Or put the volatile content in an IFRAME

--




| >-----Original Message-----
| >Hi,
|
| Howdy.
|
| >I have a page that refreshes every 5 seconds... The
| >problem is that if the user has scrolled down the page
| >before the page refreshes, when the page refreshes the
| >page starts at the top again. I would like to add some
| >java script or asp code that would remember where the
| >page was before the refresh and keeps it there. Is this
| >possible, if so, could you please provide some help.
|
| This would be fairly difficult. When your timer fires,
| you would have to detect the window's current scroll
| position, then either append it to the request or save it
| as a cookie.
|
| If you append the scroll position to the request, some
| code on the Web server would have to include it in a
| script that positioned the page on load.
|
| If you write the scroll position to a cookie, some code
| in the new page would have to retrieve the cookie and
| scroll the window.
|
| Either way, the result won't be smooth. The display will
| visibly jump to the top and then scroll down.
|
| If the amount of data is fairly small, I would consider
| making the server generate an image on the fly. Then, you
| can just reload the image, much as you would for a
| rollover.
|
| Jim Buyens
| Microsoft FrontPage MVP
| http://www.interlacken.com
| Author of:
| *----------------------------------------------------
| |\---------------------------------------------------
| || Microsoft Office FrontPage 2003 Inside Out
| || Microsoft FrontPage Version 2002 Inside Out
| || Web Database Development Step by Step .NET Edition
| || Troubleshooting Microsoft FrontPage 2002
| || Faster Smarter Beginning Programming
| || (All from Microsoft Press)
| |/---------------------------------------------------
| *----------------------------------------------------
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top