<html>
<head>
<title>
Test Images
</title>
</head>
<script type="text/javascript">
var image1 = new Image();
image1.src = "purple.gif";
var image2 = new Image();
image2.src = "red.gif";
var image3 = new Image();
image3.src = "blue.gif";
var image4 = new Image();
image4.src = "yellow.gif";
var image5 = new Image();
image5.src = "green.gif";
var image6 = new Image();
image6.src = "pink.gif";
window.onload=randomimageid();
function check()
{
var img_name = new Array("purple.gif", "red.gif", "blue.gif", "yellow.gif", "green.gif", "pink.gif");
var l = img_name.length;
var rnd_no = Math.floor(l*Math.random());
document.r_img.src = img_name[rnd_no];
}
function randomimageid()
{
var img_name = new Array("purple.gif", "red.gif", "blue.gif", "yellow.gif", "green.gif", "pink.gif");
var l = img_name.length;
var rnd_no = Math.floor(l*Math.random());
document.getElementById("randomimage").src = img_name[rnd_no];
setTimeout("randomimageid()",1000);
}
</script>
<body onLoad="randomimageid();">
<h2> test images</h2>
<img src="purple.gif" width="100" height="50"
name="randomimage" id="randomimage" alt="Random image" />
</body>
</html>
|