Forum Moderators: open
.js file
------------------------------
<!-- Begin
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 4000;
// Duration of crossfade (seconds)
var crossFadeDuration = 8;
// Specify the image files
var Img = new Array();
// to add more images, just continue
// the pattern, adding to the array below
Img[0] = 'http://www.site.com/images/main1.jpg'
Img[1] = 'http://www.site.com/images/main2.jpg'
Img[2] = 'http://www.site.com/images/main2.jpg'
// do not edit anything below this line
var t;
var j = 0;
var p = Img.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Img[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);
}
// End -->
-------------------------------
in <body>:
onLoad="runSlideShow()"
---------------------------------
in HTML:
<img src="http://www.site.com/images/main1.jpg" name='SlideShow' width="400" height="300" title="site />
---------------------------------
Thank you so much for your help :)
And then in the function immediately after the line that reads "document.images.SlideShow.src = preLoad[j].src;" Add this line after that:
document.getElementById("changeable").href = links[j];
Then in the body of the html, wrap the default image in a set of anchor tags with an id in them:
<a href="defaultpage.html" id="changeable"><img src="http://www.site.com/images/main1.jpg" name="SlideShow" width="400" height="300" alt="picture" title="site" /></a>
You may be aware that the crossfade in that script only works in IE. You could do some research also there are slideshows out there that have crossfades that work in FF and others also.