PDA

View Full Version : Slideshow Help - Onload Conflict



emjaces
07-29-2007, 04:35 PM
1) Script Title: Presentational Slideshow Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/presentationslide.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:

onload="preloadImages();"

DD script:

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



Any help is appreciated. Thanks

emjaces
07-29-2007, 04:47 PM
I think i just figured it out...


I removed this part of the code:



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

and I edited the body tag like so:



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


Seems to work OK!:D

jscheuer1
07-29-2007, 09:24 PM
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:


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

to:


if (!ie4&&!dom)
setInterval("rotateimage()",pause)

And have in your body tag:


<body onload="preloadImages(); if (ie4||dom) { startit(); };">

emjaces
07-29-2007, 10:31 PM
Great! I am going to modify the code as you suggested. Many thanks!:D