使用JavaScript调整浏览器窗口大小时会发生什么事件?
在调整浏览器大小时,可以在JavaScript中使用window.outerWidth和window.outerHeight事件获取窗口的大小。
示例
您可以尝试运行以下代码来处理事件,以检查浏览器窗口大小-
<!DOCTYPE html>
<html>
<head>
<script>
function resizeFunction() {
var val = "Window Width=" + window.outerWidth + ", Window Height="
+ window.outerHeight;
document.getElementById("test").innerHTML = val;
}
</script>
</head>
<body onresize = "resizeFunction()">
<p>Resize browser window and check the window (browser window)
height and width again.</p>
<p id = "test"> </p>
</body>
</html>热门推荐
10 浪漫的未来祝福语简短
11 接手捧花祝福语简短
12 诗词送行祝福语大全简短
13 春天变冷祝福语简短
14 金店立秋祝福语简短英文
15 情人喝酒祝福语简短的话
16 端午的祝福语毕业简短
17 护士辞职送行祝福语简短
18 手写卡片结婚祝福语简短