<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>新增網頁1</title>
<script>
function myResize() //調整大小
{
window.resizeTo(450,400);
}
function myMoveUp()//移動視窗
{
window.resizeBy(+100,+100);
}
function myMoveLeft()//移動視窗
{
window.resizeBy(-100,-100);
}
function myMoveRight()//移動視窗
{
window.moveBy(5, 0);
window.moveBy(-5, 0);
timerID=setTimeout(myMoveRight(),10) }
function myMoveDown()//移動視窗
{
clearTimeout(timerID)
}
function myMove() //調整大小
{
window.resizeTo(myForm.myX.value,myForm.myY.value);
}
</script>
<body onLoad="myResize()">
</head>
<body>
<p align="center">利用按鈕來改變視窗位置</p>
<div align="center">
<form name=myForm>
<table border="0" id="table1">
<tr>
<td align="center"> </td>
<td align="center"><input type="button" value="放大" name="big" onclick="myMoveUp()"></td>
<td align="center"> </td>
</tr>
<tr>
<td align="center"><input type="button" value="縮小" name="smill" onclick="myMoveLeft()"></td>
<td align="center"> </td>
<td align="center"><input type="button" value="震動" name="ran" onclick="myMoveRight()"></td>
</tr>
<tr>
<td align="center"> </td>
<td align="center"><input type="button" value="停止震動" name="stop" onclick="myMoveDown()"></td>
<td align="center"> </td>
</tr>
<tr>
<td align="center">X座標</td>
<td align="center">
<input type="text" value="0" name="myX" size="10"></td>
<td align="center" rowspan="2">
<input type="button" value="視窗大小" name="move" onclick="myMove()"></td>
</tr>
<tr>
<td align="center">Y座標</td>
<td align="center">
<input type="text" value="0" name ="myY" size="10"></td>
</tr>
</table>
</form>
</div>
</body>
</html>