Rotating picture over 24h (We use Webcamfirst possibility to store one picture every hour on the server. Tick "hour_index" in the prog.setting page)
Simple code in javascript
<html> <head> <script language=JavaScript> tableau=new Array; tableau[0]="Photo_h00.jpg"; tableau[1]="Photo_h01.jpg"; tableau[2]="Photo_h02.jpg"; tableau[3]="Photo_h03.jpg"; tableau[4]="Photo_h04.jpg"; tableau[5]="Photo_h05.jpg"; tableau[6]="Photo_h06.jpg"; tableau[7]="Photo_h07.jpg"; tableau[8]="Photo_h08.jpg"; tableau[9]="Photo_h09.jpg"; tableau[10]="Photo_h10.jpg"; tableau[11]="Photo_h11.jpg"; tableau[12]="Photo_h12.jpg"; tableau[13]="Photo_h13.jpg"; tableau[14]="Photo_h14.jpg"; tableau[15]="Photo_h15.jpg"; tableau[16]="Photo_h16.jpg"; tableau[17]="Photo_h17.jpg"; tableau[18]="Photo_h18.jpg"; tableau[19]="Photo_h19.jpg"; tableau[20]="Photo_h20.jpg"; tableau[21]="Photo_h21.jpg"; tableau[22]="Photo_h22.jpg"; tableau[23]="Photo_h23.jpg";
uneDate= new Date();
var index=uneDate.getHours(); // index initialisation at the current hour
function plus(index)
{
document.image.src=tableau[index];
if(index==tableau.length-1)
{
index=0;
}
else
{
index++;
}
timerID=setTimeout("index=plus(index)",2000); // 2 secondes between each picture
return index;
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body onload="index=plus(index)" >
<div align="center"><img name="image" height=480 width=640>
</div>
<p> </p>
<p align="center"><img src="Photo_h17.jpg" width="640" height="480"></p>
</body>
</html>
|