I'm trying to figure out how to cycle a set of pictures with the corresponding descriptions in a table, here is my picture code:
Code:
<script type="text/javascript">
var imgArray = new Array(6);
imgArray[0] = new Image;
imgArray[0].src = "../Images/LondonBus.jpg";
imgArray[1] = new Image;
imgArray[1].src = "../Images/eiffeltower.jpg";
imgArray[2] = new Image;
imgArray[2].src = "../Images/polishmines.jpg";
imgArray[3] = new Image;
imgArray[3].src = "../Images/vailskiing.jpg";
imgArray[4] = new Image;
imgArray[4].src = "../Images/steamboatskiing.jpg";
imgArray[5] = new Image;
imgArray[5].src = "../Images/polishmines.jpg";
var index =0;
function cycle()
{
document.pic.src = imgArray[index].src;
index++;
if (index==6)
{
index = 0;
}
setTimeout("cycle()", 3000);
return;
}
</script>
But the main problem I have is converting similar code into rotating text,
Code:
<SCRIPT type = "text/javascript">
quotation = new Array();
quotation[0] = "London"
quotation[1] = "Paris"
quotation[2] = "Poland"
quotation[3] = "Vail"
quotation[4] = "Steamboat"
quotation[5] = "Poland"
function cycle()
{
document.text.src = imgArray[index].src;
index++;
if (index==6)
{
index = 0;
}
setTimeout("cycle()", 3000);
return;
}
window.onload=changetext();
</script>
I know that the document.text.src is wrong for text references so how could I link that to a div id or table box?
Thank you!