New Revised CSS Library Forums Web Tools
FAQs Awards Usage Terms Contact
Other Sections
Sweet Ads
Bookmark online:

FF1+ IE5+ Opr7+

Memory Scroller

Author: Dynamic Drive

Description: This thoughtful DHTML scroller remembers its last scrolled position just before the visitor navigates to another page, and upon his return (within the same browser session), picks up the scrolling from where it last left off. For scrollers that contain a long message, this is an indispensable feature. The script saves its last scrolled position when one of the following two actions occur on the page:

1) When the page is unloaded in general, and the visitor goes to another page, OR
2) When the scroller is clicked on, and the user unloads the page that way.

Which action to adopt is up to you.

Demo: Make a note of the current scroller position, and try reloading the current page or going to another URL then returning. The scroller will continue from where it last left off.

Directions Developer's View

Simply insert the below script into the <BODY> section of your page, and configure the variables within:

Select All

One variable within the script that may require a bit of elaboration is:

var persistmsgbehavior="onload" //set to "onload" or "onclick".

As explained briefly in the Introduction, this script can remember its last scrolled position in two different ways. Set "persistmsgbehavior" to "onload" to inform script to save last scrolled position whenever the page unloads and the visitor is taken to a different page in general. Set "persistmsgbehavior" to "onclick" instead if you only wish last scrolled position to be saved if the visitor clicks a link within the scroller and unloads the page that way. In other words, only when the visitor interacts with the scroller. If you're confused which method to choose, in most cases, the default "onload" will do nicely.