Results 1 to 6 of 6

Thread: Memory Scroller always starts from beginning

  1. #1
    Join Date
    Oct 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Memory Scroller always starts from beginning

    1) Script Title: Memory Scroller script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ryscroller.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:
    http://amishmarketmullicahill.com/beilersbakery.html

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

    thanks for you help.


    g

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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:

    Code:
    if (persistlastviewedmsg && persistmsgbehavior=="onload")
    window.onunload=savelastmsg
    in the script with:

    Code:
    if (window.addEventListener)
    window.addEventListener("unload", savelastmsg, false)
    else if (window.attachEvent)
    window.attachEvent("onunload", savelastmsg)
    Last edited by ddadmin; 10-19-2007 at 09:39 PM.

  3. #3
    Join Date
    Oct 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default still does not work.

    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?

    thanks

    g

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Oct 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

    thanks.

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

  6. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Ops, there is an error in the code I posted above (which I've just edited). Change it to:

    Code:
    if (window.addEventListener)
    window.addEventListener("unload", savelastmsg, false)
    else if (window.attachEvent)
    window.attachEvent("onunload", savelastmsg)
    Try that.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •