Phall1007
Joined: 09 Aug 2004 Posts: 5
|
Posted: Sat Aug 14, 2004 3:40 pm Post subject: java/dhtml help needed |
|
|
I have the following code which refreshes an image every 5 seconds. Does anyone have any idea how to do the same with another image on the same page? I can't seem to get it to work with more than one image.
Code: |
<script LANGUAGE="JavaScript">
<!--
function reloadImg()
{
uniq = new Date();
uniq = "?"+uniq.getTime();
newImage = document.all.imgToLoad.src;
index = newImage.indexOf("?", 0);
if (index > 0)
{
newImage = document.all.imgToLoad.src;
}
document.all.imgToLoad.src = newImage+uniq;
}
// -->
</script>
<img src="IMG_SRC_HERE" width="200" height="150" id="imgToLoad" onload="setTimeout("reloadImg()",5000)"> |
|
|