So I did some research and found something very close to what I need (a very, very simple auto slideshow using images within an array). However, the code I found is not actually using images and I'm not quite sure how to alter the code so that it will work with an array of images instead of strings. I've only gotten as far as creating the array with images...
Any help would be very appreciated!
<!DOCTYPE html>
<html>
<head>
<script>
var wss_i = 0;
var wss_elem;
var wss_array = new Array;
wss_array[0] = "img0.png";
wss_array[1] = "img1.png";
wss_array[2] = "img2.png";
wss_array[3] = "img3.png";
wss_array[4] = "img4.png";
wss_array[5] = "img5.png";
function wssNext(){
wss_i++;
if(wss_i > (wss_array.length - 1)){
wss_i = 0;
}
setTimeout('wssSlide()',1000);
}
function wssSlide(){
wss_elem.innerHTML = wss_array[wss_i];
setTimeout('wssNext()',2000);
}
</script>
</head>
<body>
<h1>My dog is <span id="wss"></span></h1>
<script>wss_elem = document.getElementById("wss");
wssSlide();
</script>
</body> </html>
var wss_array = [ list of elements ], and 2. passing strings tosetTimeout, 3. massive pollution wuth global variables