Re: Animation with Javascript

by Noone Special <pfarabee(at)indy.net>

 Date:  Thu, 2 Jul 1998 11:15:31 -0500 (EST)
 To:  robert <robert(at)diva.nl>
 Cc:  Efrat Sheffy <esheffy(at)inter.net.il>, hwg-graphics(at)hwg.org
 In-Reply-To:  diva
  todo: View Thread, Original
Whoops.. his code won't lock up your browser, but it won't work either..
Here is a modification of his Javascript that will work:

This goes in the head;
<script language="JavaScript">
<!--
// Dummy function for older browsers
function rollPics(){}
//-->
</script>
<script language="JavaScript1.1">
<!--begin
var counter=1;
function rollPics(){
document.go.src=counter+".jpg";
counter++;
if(counter>3){
counter=1;
// The one thing he forgot.. keep the animation going.
setTimeout('rollPics()',1000)
}
//end-->
</script>

put something like this in the body of the document;

<center>
<img name="go" src="a.jpg" onLoad="setTimeout('rollPics()',1000)">
</center>



Basically, his code with one extra line.

Pat

HWG: hwg-graphics mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.