View Full Version : Memory Scroller always starts from beginning

10-18-2007, 08:55 PM
1) Script Title: Memory Scroller script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/memoryscroller.htm

3) Describe problem: This works perfectly in the DD page.
When I copy and paste the script into a my page, it doesn't remember the position. Always starts from the beginning.
No matter what I do or browser I try it in. (mac, safari, firefox)
I've even stripped a page and used the straight developers html..same result.

I thought it was due to being in a component (Adobe golive), but, it makes no difference.

Again, I paste the exact script into place, no changes, and it will always start from the front.

here is the site:

you can click thru the links and see
this particular script is in a GoLive component.

thanks for you help.


10-19-2007, 06:55 AM
The script saves the scroller's last known position when the page unloads (window.onunload). It's possible another script on your page is using the same event handler, canceling this one out. Try replacing:

if (persistlastviewedmsg && persistmsgbehavior=="onload")

in the script with:

if (window.addEventListener)
window.addEventListener("unload", savelastmsg, false)
else if (window.attachEvent)
window.attachEvent("onunload", savelastmsg)

10-19-2007, 12:09 PM
still does not work.
as mentioned, i took a blank page and inserted the developers code and it still would not work. (there wasn't anything that could possible have interferred.

thanks for trying.
Can anyone else help?



10-19-2007, 12:28 PM
One of two things is happening--

1. The script doesn't work at all on your computer.
Test this-- does the demo PAGE (not code) work in all/any of your browsers?

2. You are somehow still copying it incorrectly.

Do you have cookies disabled? That's how the position is stored, I believe.

10-19-2007, 12:33 PM
script works fine on the test page in DD

It's a simple copy and paste, that's what's so frustrating. I do it all the time.

cookies are enabled.


you can see the exact code in the pages I posted.

10-19-2007, 09:40 PM
Ops, there is an error in the code I posted above (which I've just edited). Change it to:

if (window.addEventListener)
window.addEventListener("unload", savelastmsg, false)
else if (window.attachEvent)
window.attachEvent("onunload", savelastmsg)

Try that.