Thread: Sponsor Box
View Single Post
  #1   Spotlight this post!  
Unread 14-04-2013, 14:45
ace94x's Avatar
ace94x ace94x is offline
Murphy
AKA: Matt Murphy
FRC #1094 (Channel Cats)
Team Role: Webmaster
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Missouri
Posts: 70
ace94x is an unknown quantity at this point
Sponsor Box

I put this code right into the body of my website where I wanted it to go

The order is 1/2/3/1 that way it repeats itself correctly, at 2seconds each frame (2000 milliseconds)

function imgOne() //First Image function
{
document.myimg.src = 'images1.jpg'; //First Image
setTimeout("imgTwo()", seconds * 2000); // After 2 seconds will change to Image Too
}

I took out the Fade in/out but it is not hard to add back in, just google "Image Fade in/out" and insert the times and function under each image.



Code:
<script language="javascript" type="text/javascript">

img2 = new Image()


seconds = "2";

function imgOne()
{	
	document.myimg.src = 'images1.jpg';
	setTimeout("imgTwo()", seconds * 2000);
}
function imgTwo()
{
	document.myimg.src = 'images2.jpg';
	setTimeout("imgThree()", seconds * 2000);
}
function imgThree()
{
	document.myimg.src = 'images3.jpg';
	setTimeout("imgOne()", seconds * 2000); //reverts back to first image
}

</script>

<body onLoad="imgOne();"/>
__________________