'innerWidth'에 해당되는 글 1건

  1. 2010.12.28 .innerHeight() .innerWidth()

2010. 12. 28. 12:23 jQuery

.innerHeight() .innerWidth()

.innerHeight()
픽셀의 위쪽과 아래쪽 패딩을 포함한 요소의 높이를 반환한다.
윈도우와 문서 개체에 적용되지 않는다. 윈도우와 문서 개체에 대해 사용할 땐 .height()를 사용한다.


사용예

<!DOCTYPE html>
<html>
<head>
  <style>p { margin:10px;padding:5px;border:2px solid #666; }</style>
  <script src="http://code.jquery.com/jquery-1.4.4.js"></script>
</head>
<body>
  <p>Hello</p><p></p>
<script>var p = $("p:first");
$("p:last").text( "innerHeight:" + p.innerHeight() );</script>

</body>
</html>

.innerWidth()


픽셀의 왼쪽과 오른쪽 패딩을 포함한 요소의 높이를 반환한다.
윈도우와 문서 개체에 적용되지 않는다. 윈도우와 문서 개체에 대해 사용할 땐 .width()를 사용한다.

사용예

<!DOCTYPE html>
<html>
<head>
  <style>p { margin:10px;padding:5px;border:2px solid #666; } </style>
  <script src="http://code.jquery.com/jquery-1.4.4.js"></script>
</head>
<body>
  <p>Hello</p><p></p>
<script>var p = $("p:first");
$("p:last").text( "innerWidth:" + p.innerWidth() );</script>

</body>
</html>

'jQuery' 카테고리의 다른 글

Attribute Contains Selector [name*="value"]  (0) 2010.12.30
Attribute Contains Word Selector [name~="value"]  (0) 2010.12.30
.addClass() .removeClass()  (0) 2010.12.28
.fadeIn() .fadeOut()  (0) 2010.12.28
.show() .hide()  (0) 2010.12.28
Posted by IT
이전버튼 1 이전버튼

블로그 이미지
IT

공지사항

Yesterday
Today
Total

달력

 « |  » 2025.5
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함