I have an array with 13 items, all of it is text. I can show text from the array by using.
document.write(arrayname["0"]);
however I would like to have users click a button and fade out the current array item and load in the next array item. I wanted to have users not be able to view an array item less than 0 and more than 13 since that would cause an error.
I tried this but could not get it to work.
Thank you in advance.
<script type=text/javascript>
var stuff=['item', 'stuff', 'thingamajig'];
var counter=0;
function goRight(){
if(counter===13){
counter=13;
} else
{ counter=counter+1 }
}
document.write(stuff[counter]);
</script>
<img src="left.png"><img onclick="goRight(); src="right.png>