JQuery 화면크기 확인

Jmnote (토론 | 기여)님의 2016년 12월 20일 (화) 14:32 판 (새 문서: ==개요== ;jQuery 화면크기 확인 * 너비: $(windows).width() * 높이: $(windows).height() ==예시== <source lang='html'> <button id="update-btn">화면크기 얻기</button...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

jQuery 화면크기 확인
  • 너비: $(windows).width()
  • 높이: $(windows).height()

2 예시

<button id="update-btn">화면크기 얻기</button>
<input type="text" id="size" />

<script src="//code.jquery.com/jquery.min.js"></script>
<script>
$("#update-btn").click(function() {
  $('#size').val( $(window).width() + " × " + $(window).height() );
});
</script>
→ 단, 여기서는 Result 창의 내부크기임...

3 같이 보기

4 참고 자료

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