<html>
<head>
<title>視窗效果</title>
<script language="JavaScript">
function smallerWin() {
window.resizeBy(-100,-100)
}
function largeWin() {
window.resizeBy(100,100)
}
function resizeWin() {
var width, height
width = parseInt(myForm.wSize.value)
height = parseInt(myForm.hSize.value)
if (width > 0 && height > 0 )
window.resizeTo(width, height)
else
alert("請輸入視窗尺寸!")
}
function startShake() {
var level = 5
window.moveBy(0, level)
window.moveBy(0, -level)
window.moveBy(level, 0)
window.moveBy(-level, 0)
timerID = setTimeout("startShake()",10)
}
function stopShake() {
clearTimeout(timerID)
}
</script>
</head>
<body bgcolor="lightyellow">
<form id="myForm">
<input type="button" οnclick="smallerWin()" value="縮小視窗">
<input type="button" οnclick="largeWin()" value="放大視窗"><br><br>
<input type="button" οnclick="startShake()" value="開始振動">
<input type="button" οnclick="stopShake()" value="停止振動"><br><br>
寬: <input type="text" id="wSize" value="500"><br>
高: <input type="text" id="hSize" value="300">
<input type="button" οnclick="resizeWin()" value="調整視窗尺寸">
</form>
</body>
</html>
缩小调大浏览器窗口-IE
最新推荐文章于 2021-04-14 13:25:23 发布