<HTML><head>
<Script language="JavaScript">
<!--
function changePos()
{
width = document.body.clientWidth; //the width of the current document
height = document.body.clientHeight; //the height of the current document
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
img.style.left = xPos;
img.style.top = yPos;
if (yon)
{
yPos = yPos + 5;
}
else
{
yPos = yPos - 5;
}
if(yPos < -Hoffset)
{
yon = 1; yPos = -Hoffset;
}
if(yPos >= height)
{
yon = 0; yPos = height;
}
}
//-->
</Script>
</head>
<body>
<IMG id="img" style="POSITION: absolute" src="Images\Colored.jpg">
<SCRIPT language=JavaScript>
<!--
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0; //false
var xPos = 20;
var yPos = document.body.clientHeight;
var Timer1 = setInterval('changePos()',30);
//-->
</Script>
</BODY>
</HTML>
所以我的问题是,我如何在这个动画中添加一个新图像,并以一种与旧图像交替的方式制作它(例如:我拥有的图像是彩色的,我想给它添加一个黑白图像,所以他们交替在一起!