(一).示例图片效果
(二).代码
<html>
<head>
<title>window.scrollTo()函数</title>
<script laguage="javascript">
<!--
function scrollwin(form)
{
var winx=form.X.value;
var winy=form.Y.value;
window.scrollTo(winx,winy);
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form>
<table border=0 align=center>
<tr>
<td colspan=3 align=center bgcolor=lightgreen><font color=blue size=3>
请输入窗口的位置:</font></td></tr>
<tr>
<td><input type=text name="X" style="background-color:lightblue;color:blue"></td>
<td><input type=text name="Y" style="background-color:lightblue;color:blue"></td>
<td><input type=button value="scroll window" onclick=scrollwin(this.form) style="background-color:ligntblue;"></td>
</tr>
</table>
</form>
</body>
</html>