Hallo,
Ik heb een stukje script om het plaatsje van de achtergrond van een tabel om e aantal seconden te veranderen.
Graag zou ik dit fadend willen hebben.
Ik krijg het alleen niet voor elkaar.
Iemand een oplossing?
<script type="text/javascript">
var ImgAry=['headerpic1.jpg','headerpic2.jpg','headerpic3.jpg'];
// preload the images
for (var img,z0=0;z0<ImgAry.length;z0++){
img=ImgAry[z0];
ImgAry[z0]=new Image();
ImgAry[z0].src=img;
}
var cnt=0,to=null;
function Rotate(){
cnt=++cnt%ImgAry.length;
document.getElementById('t1').style.backgroundImage='url('+ImgAry[cnt].src+')';
to=setTimeout(function(){ Rotate(); },2000);
}
</script></head>
<body onload="Rotate();">
<table width="528" height="362" border="0" cellpadding="0" cellspacing="0" background="headerpic1.jpg" id="t1">
<tr>
<td>text</td>
</tr>
</table>
</body>
</html>
1.758 views