hello everyone,
i cannot get this script to work. i get an error that says "causewaypics[...]src'is null or not an object". can someone please help me, i've been staring at this for too long!
thanks
=======================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Causeway Photo Album</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!--
causewaypics=new Array(5);
causewaypics[0]=new Image();
causewaypics[0].src="ultimate1.jpg";
causewaypics[1]=new Image();
causewaypics[1].src="ultimate2.jpg";
causewaypics[2]=new Image();
causewaypics[2].src="ultimate3.jpg";
causewaypics[3]=new Image();
causewaypics[3].src="ultimate4.jpg";
causewaypics[4]=new Image();
causewaypics[4].src="ultimate5.jpg";
causewaypics[5]=new Image();
causewaypics[5].src="xmascards.jpg";
causewaypics=new Array("ultimate1.jpg","ultimate2.jpg","ultimate3.jpg",
"ultimate4","ultimate5.jpg","xmascards.jpg"
function randomPic(){
var element=Math.round(Math.random()*3);
var element2=Math.round(Math.random()*3)+4;
document.pic1.scr=causewaypics[element].src;
document.pic2.scr=causewaypics[element2].src;
setTimeout("randomPic()",2000);
}
//-->
</script>
</head>
<body onLoad="randomPic()">
<center><h3>Causeway Photo Album</h3>
<table>
<tr>
<td><img src="images/ultimate1.jpg" name="pic1"></td>
<td><img src="images/xmascards.jpg" name="pic2"></td>
</tr>
</table>
</center>
</body>
</html>
i cannot get this script to work. i get an error that says "causewaypics[...]src'is null or not an object". can someone please help me, i've been staring at this for too long!
thanks
=======================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Causeway Photo Album</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!--
causewaypics=new Array(5);
causewaypics[0]=new Image();
causewaypics[0].src="ultimate1.jpg";
causewaypics[1]=new Image();
causewaypics[1].src="ultimate2.jpg";
causewaypics[2]=new Image();
causewaypics[2].src="ultimate3.jpg";
causewaypics[3]=new Image();
causewaypics[3].src="ultimate4.jpg";
causewaypics[4]=new Image();
causewaypics[4].src="ultimate5.jpg";
causewaypics[5]=new Image();
causewaypics[5].src="xmascards.jpg";
causewaypics=new Array("ultimate1.jpg","ultimate2.jpg","ultimate3.jpg",
"ultimate4","ultimate5.jpg","xmascards.jpg"
function randomPic(){
var element=Math.round(Math.random()*3);
var element2=Math.round(Math.random()*3)+4;
document.pic1.scr=causewaypics[element].src;
document.pic2.scr=causewaypics[element2].src;
setTimeout("randomPic()",2000);
}
//-->
</script>
</head>
<body onLoad="randomPic()">
<center><h3>Causeway Photo Album</h3>
<table>
<tr>
<td><img src="images/ultimate1.jpg" name="pic1"></td>
<td><img src="images/xmascards.jpg" name="pic2"></td>
</tr>
</table>
</center>
</body>
</html>