크기 조정 이벤트는 창 크기가 조정될 때 트리거됩니다. window.outerWidth 사용 및 window.outerHeight 브라우저의 크기를 조정할 때 창 크기를 가져오는 JavaScript의 이벤트
예시
다음 코드를 실행하여 JavaScript에서 onresize 이벤트를 사용할 수 있습니다.
<!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>