您的位置:首页 > 其它

window.scrollTo()方法使用示例

2006-01-07 21:22 986 查看
(一).示例图片效果



(二).代码

<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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: