Code:
<script type="text/javascript">
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully
// =======================================
// set the following variables
// =======================================
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files
var Pic = new Array(), Alt = new Array(); // don't touch this
// to add more images, just continue
// the pattern, adding to the array below
Pic[0] = 'gifs & jpegs/image 6.jpg';
Pic[1] = 'gifs & jpegs/Diamond Trip 3.jpg';
Pic[2] = 'gifs & jpegs/image 5.jpg';
Pic[3] = 'gifs & jpegs/image 3.jpg';
Pic[4] = 'gifs & jpegs/Oct2006.jpg';
Pic[5] = 'gifs & jpegs/image 8.jpg';
Pic[6] = 'gifs & jpegs/image 4.jpg';
Alt[0] = 'the number six';
Alt[1] = 'a pretty diamond';
// ... and so on...
// =======================================
// do not edit anything below this line
// =======================================
var t,
j = 0,
p = Pic.length;
var preLoad = new Array()
for (i = 0; i < p; i++) (preLoad[i] = new Image()).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;
document.images.SlideShow.alt = (Alt[j] || "");
if (document.all) document.images.SlideShow.filters.blendTrans.Play();
j++;
if (j > (p-1)) j=0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}
</script>
However, two things to note:
1) Alts are a bit pointless here, since a browser is far less likely to have Javascript than image support (although I do have one); if you want the mouse-over tooltip effect, you should use title instead.
2) That script is quite badly-written. If I may, I would suggest this modification of a DD script instead; it supports IE and standards-compliant browsers and alt and title attributes already (set the slide descriptions). The controls, if you do not want them, can be hidden by wrapping them in a <div style="display:none;">.
Bookmarks