chestnut2007
Programmer
I just tried to make randum images which shows one of them when I rolled over the image.
I just set randum array and variable to output the images when I rolled over.
These scripting below is my scripting. But it does not work...
Could you help me??
Thanks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"<html>
<head>
<script language="JavaScript"><!--
var imglist = new Array(
"flowerA.gif",
"flowerB.gif",
"flowerC.gif",
"flowerD.gif" );
var selectnum = Math.floor((Math.random() * 100)) % imglist.length;
var output = "<img src=" + imglist[selectnum] + ">";
myImgOut = new Image(); // the mouse roll out
myImgOut.src = "flowerA.gif"; // loading image
myImgOver = new Image(); // the mouse over image
myImgOver.src = "output"; // I just tried to put output variable name.but I think it is not correct...
function myMouseOut(){ // mouse roll out
myFormImg.src = myImgOut.src; //show the image
}
function myMouseOver(){ // mouse roll over
myFormImg.src = myImgOver.src;// show the image
}
// --></script>
<title>flower</title>
</head>
<body>
<div align="center">
<a href="" onMouseOver="myMouseOver()" onMouseOut="myMouseOut()">
<img border="0" name="img" src="flowerA.gif"></a></div>
</body>
</html>
I just set randum array and variable to output the images when I rolled over.
These scripting below is my scripting. But it does not work...
Could you help me??
Thanks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"<html>
<head>
<script language="JavaScript"><!--
var imglist = new Array(
"flowerA.gif",
"flowerB.gif",
"flowerC.gif",
"flowerD.gif" );
var selectnum = Math.floor((Math.random() * 100)) % imglist.length;
var output = "<img src=" + imglist[selectnum] + ">";
myImgOut = new Image(); // the mouse roll out
myImgOut.src = "flowerA.gif"; // loading image
myImgOver = new Image(); // the mouse over image
myImgOver.src = "output"; // I just tried to put output variable name.but I think it is not correct...
function myMouseOut(){ // mouse roll out
myFormImg.src = myImgOut.src; //show the image
}
function myMouseOver(){ // mouse roll over
myFormImg.src = myImgOver.src;// show the image
}
// --></script>
<title>flower</title>
</head>
<body>
<div align="center">
<a href="" onMouseOver="myMouseOver()" onMouseOut="myMouseOut()">
<img border="0" name="img" src="flowerA.gif"></a></div>
</body>
</html>