Click to See Complete Forum and Search --> : images in sequence


andyru
11-19-2003, 09:24 PM
Hi

What's the name for an array of images that oad one after the other? With the name I'll find the script, :)

andyru

pyro
11-19-2003, 09:56 PM
You'll have to be a bit clearer than that, me thinks...

andyru
11-20-2003, 08:00 AM
OK. I want a script that simply loads images in a cell, one after the other with a brief pause in between. Can you point me to it?

andyru

pyro
11-20-2003, 08:12 AM
Try something like this:

<script type="text/javascript">
imgs = new Array("http://forums.webdeveloper.com/images/smilies/smile.gif", "http://forums.webdeveloper.com/images/smilies/frown.gif", "http://forums.webdeveloper.com/images/smilies/biggrin.gif"); //array of images
function rotate() {
document.getElementById("rotimg").src = imgs[Math.floor(Math.random() * imgs.length)];
}
setInterval("rotate()", 5000); //set time in milliseconds
</script>
</head>
<body>
<p><img src="http://forums.webdeveloper.com/images/smilies/smile.gif" id="rotimg"></p>