I'm trying to create this animated gif array. Everything is in place, almost exactly like another one I did successfully. But I must be overlooking something here. If anyone can take a look at the code and give me suggestions I would appreciate it. Thanks.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>puppies</title>
<script type="text/javascript">
var rusty=new Array(7);
rusty[0]="puppies/puppy.gif";
rusty[1]="puppies/puppy0.gif";
rusty[2]="puppies/puppy1.gif";
rusty[3]="puppies/puppy2.gif";
rusty[4]="puppies/puppy3.gif";
rusty[5]="puppies/puppy4.gif";
rusty[6]="puppies/puppy5.gif";
var myPup=[0];
function getPup(){
if(myPup<rusty.length){
myPup = 0;
}
else{
document.getElementById("pup").src="puppies/"+ rusty[myPup];
myPup = myPup+1;
}
}
setTimeout("getPup()", 1000)
</script>
</head>
<body>
<h1>Puppies</h1>
<img src="puppies/puppy0.gif" id="pup" width="97" height="60" alt="puppy" onclick="getPup()"/>
</body>
</html>
