Results 1 to 4 of 4

Thread: Slideshow Help - Onload Conflict

  1. #1
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Slideshow Help - Onload Conflict

    1) Script Title: Presentational Slideshow Script

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

    3) Describe problem: Hi all. I have implemented the above script on a webpage which also uses ImageReady rollover. When i installed the DD script, rollovers stopped working. ImageReady obviously uses the onload command in the body tag, so i suspect thats what is causing the issue, i just dont know which part of the DD script to modify. Please help me figure this out...here is what i have:

    Body tags:
    Code:
    onload="preloadImages();"
    DD script:
    Code:
    if (ie4||dom)
    window.onload=startit
    else
    setInterval("rotateimage()",pause)


    Any help is appreciated. Thanks
    Last edited by emjaces; 07-29-2007 at 04:52 PM.

  2. #2
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I think i just figured it out...


    I removed this part of the code:

    Code:
    if (ie4||dom)
    window.onload=startit
    else
    setInterval("rotateimage()",pause)
    and I edited the body tag like so:

    Code:
    <body onload="preloadImages(); startit();">

    Seems to work OK!

  3. #3
    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

    Pretty good! That will work with all modern browsers. If you want to maintain the backward compatibility of the Presentational Slideshow Script, you should instead change:

    Code:
    if (ie4||dom)
    window.onload=startit
    else
    setInterval("rotateimage()",pause)
    to:

    Code:
    if (!ie4&&!dom)
    setInterval("rotateimage()",pause)
    And have in your body tag:

    Code:
    <body onload="preloadImages(); if (ie4||dom) { startit(); };">
    - John
    ________________________

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

  4. #4
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Great! I am going to modify the code as you suggested. Many thanks!

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
  •