Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script language="javascript">
- var delay=1000 //set delay in milliseconds
- var curindex = 0
- var randomimages=new Array()
- randomimages[0]="1.jpg"
- randomimages[1]="3.jpg"
- randomimages[2]="2.jpg"
- document.write('<img name="defaultimage" src="'+randomimages[Math.floor(Math.random()*(randomimages.length))]+'">')
- function rotateImage()
- {
- curindex = (curindex + 1) % randomimages.length
- document.images.defaultimage.src = randomimages[curindex]
- }
- setInterval("rotateImage()", delay)
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement