R
Reid Goldsborough
Hi. I'm a JavaScript neophyte. I'm trying to create a JPEG animation,
with one coin (tet) morphing into another. The code doesn't work.
Anybody feel like taking a shot at correcting me? It's short. Here it
is:
<HTML>
<HEAD>
<TITLE>Thracian tetradrachm animation</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- begin script
tetSeries = new Array("tet00.jpg", "tet01.jpg", "tet02.jpg",
"tet03.jpg", "tet04.jpg", "tet05.jpg", "tet06.jpg",
"tet07.jpg", "tet08.jpg", "tet09.jpg");
imagesCache = new Array ()
for (i=0;i<tetSeries.length;i++) {
imagesCache = new Image;
imagesCache.src = tetSeries
}
theCount = 0;
function turnPage() {
if(theCount == imagesCache.length-1)
{
theCount = 0
} else {
theCount++
}
document.tet.src = imagesCache[theCount].src;
setTimeout("turnPage()", 300);
// end script -->
</SCRIPT>
</HEAD>
<BODY>
<img name="tet" src="tet00.jpg" width="372" height="365" border="0"
alt="Tet images">
<body bgcolor="#FFFFFF"onload="turnPage()">
</BODY>
</HTML>
Thanks.
with one coin (tet) morphing into another. The code doesn't work.
Anybody feel like taking a shot at correcting me? It's short. Here it
is:
<HTML>
<HEAD>
<TITLE>Thracian tetradrachm animation</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- begin script
tetSeries = new Array("tet00.jpg", "tet01.jpg", "tet02.jpg",
"tet03.jpg", "tet04.jpg", "tet05.jpg", "tet06.jpg",
"tet07.jpg", "tet08.jpg", "tet09.jpg");
imagesCache = new Array ()
for (i=0;i<tetSeries.length;i++) {
imagesCache = new Image;
imagesCache.src = tetSeries
}
theCount = 0;
function turnPage() {
if(theCount == imagesCache.length-1)
{
theCount = 0
} else {
theCount++
}
document.tet.src = imagesCache[theCount].src;
setTimeout("turnPage()", 300);
// end script -->
</SCRIPT>
</HEAD>
<BODY>
<img name="tet" src="tet00.jpg" width="372" height="365" border="0"
alt="Tet images">
<body bgcolor="#FFFFFF"onload="turnPage()">
</BODY>
</HTML>
Thanks.