window.outerWidth 사용 및 window.outerHeight 브라우저의 크기를 조정할 때 창 크기를 가져오는 JavaScript의 이벤트
예시
다음 코드를 실행하여 브라우저 창 크기를 확인하는 이벤트 작업을 시도할 수 있습니다. −
<!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>