Results 1 to 2 of 2

Thread: conveyor belt help - no restart in ie?

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

    Default conveyor belt help - no restart in ie?

    1) Script Title: Conveyor Belt Slideshow

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...rightslide.htm

    3) Describe problem: I have this script configured and working well (got some left/right/pause controls working, if anyone's interested: www.gregorw.com/conveyor.html), but am looking for one additional tweak to make it perfect. In Firefox, if I click one of the hyperlinked images and navigate away from the page, when I return to the site the slideshow picks up where it left off. In IE7 though, the slideshow starts over. Any way to make IE behave like Firefox in this respect?

    thanks,

    GW

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That's a peculiarity of the browsers' back buttons and how they treat scripts on the page being moved back to. Opera behaves the same way as FF in this regard with your page. However, with some scripts this feature will act differently in FF and Opera. And with some scripts it will result in the page being navigated to via the back or forward buttons of the browser unstable or unusable unless and until the page is refreshed by the user. IE almost always restarts scripts from scratch when hitting the back button, as if the page were being navigated to for the first time. This is generally the safest way to treat scripts during the forward and backward browser button navigation process because, although it doesn't pick up where it left off, it at least renders the retrieved page properly in most cases.

    You can get IE to pick up where it left off with a script by saving key pieces of data from the script in a cookie and then retrieving them from the cookie and using them to recreate the state of the script the next time the page is visited.

    For example, you would probably want to save the the direction and position of the two moving divisions and retrieve that data (when it exists) for use during the execution of the fillup function.

    Here is a good primer on cookies with sample routines that can be used to set and retrieve the value(s) you want to work with:

    http://www.quirksmode.org/js/cookies.html

    Using cookies in this manner will generally make all browsers pick up where they left off, regardless of how the page is navigated to.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •