1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| <table width='300' height='300' border='5' align='center'>
<tr><td>
<DIV ID=ejs_photo_box></DIV>
<SCRIPT LANGUAGE=JavaScript>
ejs_photo = new Array;
num = 0;
delaiEnSecondes = 2;
<?
$a = 0;
$imgDir = "photos";
$handle = opendir($imgDir);
while (($file = readdir())!=false) {
clearstatcache();
if($file!=".." && $file!="." && getimagesize("$imgDir/$file")) {
echo "ejs_photo[$a] = '$imgDir/$file';";
$a++;
}
}
closedir($handle);
?>
function ejs_aff_photos(){
if(document.getElementById){
document.getElementById("ejs_photo_box").innerHTML =
"<CENTER><IMG SRC='"+ejs_photo[num]+"' BORDER=0></CENTER>";
}
if(num==(ejs_photo.length-1)) num = -1;
num = num + 1;
setTimeout("ejs_aff_photos()", delaiEnSecondes*1000);
}
window.onload = new Function("ejs_aff_photos(0)")
</SCRIPT>
</td></tr>
</table> |
Partager