PDA

View Full Version : Help with Fade-in slideshow



sumerub
04-28-2010, 01:01 PM
Hello, I have a fade-in slideshow on my website, it works fine in all versions of IE but in other browsers the images don’t fade-in/fade-out and just change one by one.

The body code is -


<BODY onload="runSlideShow()">
<div id="slideshow01"><img src="../01.jpg" name='SlideShow' width=600 height=400></div>

The head tag code is -


<script>
var slideShowSpeed = 5000
var crossFadeDuration = 3
var Pic = new Array()
Pic[0] = '../01.jpg'
Pic[1] = '../02.jpg'
Pic[2] = '../03.jpg'
Pic[3] = '../04.jpg'
Pic[4] = '../05.jpg'
Pic[5] = '../06.jpg'
var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
preLoad[i] = new Image()
preLoad[i].src = Pic[i]
}
function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)"
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.SlideShow.filters.blendTrans.Apply()
}
document.images.SlideShow.src = preLoad[j].src
if (document.all){
document.images.SlideShow.filters.blendTrans.Play()
}
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('runSlideShow()', slideShowSpeed)
}
</script>

Any idea about where I am going wrong? I am using Dreamweaver CS4.

Thanks,
Sumeru

vwphillips
04-28-2010, 03:23 PM
blendTrans is IE only and should be avoided

google 'fade slideshow' for a more modern script

ddadmin
04-28-2010, 07:55 PM
Or just try Ultimate Fade In Slideshow (http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm). :)

sumerub
04-29-2010, 04:05 AM
Thank you for reply everyone... I will try them out.