これは私が持っているコードです:
<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 + 1;
}
else
{
yPos = yPos - 1;
}
if(yPos < 0)
{
yon = 1; yPos = 0;
}
if(yPos >= (height - Hoffset))
{
yon = 0; yPos = (height - Hoffset);
}
}
//-->
</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>
画像を上下にスクロールさせたいのですが、ページの境界線で止まることなく、つまり、画像がページの下とページのどちらかの位置に達するたびにページの上に移動する必要があります!!!!