I've been using a concise JavaScript slideshow on my website and it functions pretty well, except that the fade transition effect doesn't work in Firefox, only IE. I've tried to research this and it seems like I need to enter the following bit of...
I've been using a concise JavaScript slideshow on my website and it functions pretty well, except that the fade transition effect doesn't work in Firefox, only IE. I've tried to research this and it seems like I need to enter the following bit of script somewhere into my existing code to get it to work, but I'm pretty clueless when it comes to JavaScript and have no idea how to assimilate it into the existing slideshow script that I have. Thanks to anyone who can help!
I assume this is all I need to insert for cross-browser compatibility (correct me if I'm wrong):
Code:
function changeOpac(opacity, id) {
var object = document.getElementById(id).style;
object.opacity = (opacity / 100);
object.MozOpacity = (opacity / 100);
object.KhtmlOpacity = (opacity / 100);
object.filter = "alpha(opacity=" + opacity + ")";
}
And here's the script I want to put it into:
Code:
var slideDelay = 4500
var crossFade = 2
var Slide = new Array
("Images/Sample01.jpg","Images/Sample02.jpg","Images/Sample03.jpg","Images/Sample04.jpg","Images/Sample05.jpg","Images/Sample06.jpg");
var a
var b = 0
var c = Slide.length
var preLoad = new Array()
for (i = 0; i < c; i++){
preLoad[i] = new Image()
preLoad[i].src = Slide[i]
}
function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter="blendTrans (duration=2)"
document.images.SlideShow.style.filter="blendTrans (duration=crossFade)"
document.images.SlideShow.filters.blendTrans.Apply ()
}
document.images.SlideShow.src = preLoad[b].src
if (document.all){
document.images.SlideShow.filters.blendTrans.Play( )
}
b = b + 1
if (b > (c-1)) b=0
a = setTimeout('runSlideShow()', slideDelay)
}