jQuery 공작소 : .innerHeight()

jQuery 공작소에 방문해 주셔서 감사드립니다. 쉬운 예제로 느껴보세요!!

innerHeight 메소드는 안쪽 높이를 알아냅니다. (height + padding 값)

예제 1
기본 예제
보기
height : 100px 인 DIV 의 높이 알아보기
padding 위아래 20px, 테두리두께 위아래 각 5px
실제 DIV 의 높이는 150px 입니다.






이 예제의 innerHeight 는 height 100px + 위쪽 padding 20px + 아래쪽 padding 20px = 140px 입니다.
소스
<style type="text/css">
    .css_test {
        background : #efefef;
        border : 5px solid gray;
        margin : 0 auto; /* DIV 가운데로 정렬 */
        padding : 20px;
        width : 400px;
        height : 100px;
    }
</style>

height : 100px 인 DIV 의 높이 알아보기<br>
padding 위아래 20px, 테두리두께 위아래 각 5px<br>
실제 DIV 의 높이는 150px 입니다.<br>
<div class="css_test">
    <br><br>
    <button type="button" onclick="alert($('.css_test').innerHeight())">innerHeight 보기</button> <button type="button" onclick="alert($('.css_test').height())">height 보기(비교용)</button><br>
    <br><br>
</div>
<br>
이 예제의 innerHeight 는 height 100px + 위쪽 padding 20px + 아래쪽 padding 20px = 140px 입니다.
관련 CSS
jQuery

$( 셀렉터 ).innerHeight()  -  셀렉터에 해당하는 요소의 안쪽 높이를 알아냅니다.

- 지정된 heightpadding 의 값을 포함합니다.
- marginborder 두께값은 포함하지 않습니다.

+ 관련 jQuery +
jQuery 홈페이지 .innerHeight() API 문서 : https://api.jquery.com/innerHeight/