boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

java/dhtml help needed

 
Post new topic   Reply to topic    boardom Forum Index -> How to ?
View previous topic :: View next topic  
Author Message
Phall1007



Joined: 09 Aug 2004
Posts: 5

PostPosted: Sat Aug 14, 2004 3:40 pm    Post subject: java/dhtml help needed Reply with quote

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)">
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> How to ? All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group