JavaScript 화면크기 확인

1 개요[ | ]

JavaScript 화면크기 확인

2 예시[ | ]

<body onload="update_screen_size()" onresize="update_screen_size()">
  화면크기
  <span id="width"></span> ×
  <span id="height"></span>
</body>
<script>
  function update_screen_size() {
    document.getElementById('width').innerHTML = window.innerWidth;
    document.getElementById('height').innerHTML = window.innerHeight;
  }
</script>
→ 단, 여기서는 Result 창의 내부크기임...

3 같이 보기[ | ]

4 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}