Og blandet lidt med noget PHP :O)
<html><head><title>Slideshow</title>
<script>
// (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 = 3000
// Duration of crossfade (seconds)
var crossFadeDuration = 0
// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below
<?php
if(dirname($_SERVER["PHP_SELF"]) == "\\") {
$path = "/";
}else{
$path = dirname($_SERVER["PHP_SELF"]) ."/";
}
$fullpath = $_SERVER["DOCUMENT_ROOT"] . $path;
$x = 0;
$dir = opendir($fullpath);
while (false !== ($filer = readdir($dir))){
if (false !== @getimagesize($fullpath . $filer)) {
$x++;
echo"Pic[". ($x-1) ."] = '". $filer ."'\n";
}
}
?>
// =======================================
// do not edit anything below this line
// =======================================
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>
</head>
<body onload="runSlideShow()">
<table width="423" border="0" cellpadding="0" cellspacing="0" align="center">
<!--DWLayoutTable-->
<tr>
<td width=423 height=417 valign="top" id="VU"> <img src="1.jpg" name='SlideShow' width=480 height=60></td>
</tr>
</table>
</body></html>