|
-
Sep 15th, 2000, 09:52 PM
#1
Thread Starter
Fanatic Member
Not difficult:
Code:
<script language="javascript">
//Set up a variable to hold the current image.
var curImg
function animate(tImg){
//Check tImg to find out what the image is displayed
if(tImg == "On.jpg"){
//Set the currently displayed image
curImg = "Off.jpg"}
else{
curImg = "On.jpg"}
//Set img1 to be the current image
document.img1.src = curImg;
//set a timer up, mine change about every second
//1000 milliseconds = about 1 second.
window.setTimeout("animate(curImg)", 1000);
}
</script>
<!-- Tell the page to animate -->
<body onLoad="animate('Off.jpg')">
<img src="" name="img1">
In addition the the above you may want to add some preloading code for the images. Let me know if you need anything else.
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|