.Net Project/Jquery 1.3.2

46장 JQueryCSS 검색된 요소 구하기 (OuterWidthAndHeight)

래곤 2009. 11. 11. 12:05
반응형
 

 OuterWidthAndHeight.htm
 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title>검색 요소 (사이즈 구하기)_패내마외 기억하세요~^^;; </title>

    <style type="text/css">

        #my { background-color:Yellow;

               border:10px solid gray;

               position:absolute;

               margin:5px;

               left:10px;

               padding:10px;

               width:100px;

               height:100px;

               top:50px;                       

             }

    </style>

    <script src="../../jquery-1[1].3.2-vsdoc2.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(document).ready(function () {

            $('#btnSize').mouseover(function () {

                //outerHeight() : 마진을 제외한 제한 영역의 크기

                alert("outerHeight : " + $("#my").outerHeight());

               

                //outerHeight(true) : 마진을 포함한 영역의 크기

                alert("outerHeight(true) : " + $("#my").outerHeight(true));

                alert("outerWidth : " + $("#my").outerWidth());

                alert("outerHeight : " + $("#my").outerWidth(true));

            });

        });

    </script>

</head>

<body>

    <div id="my">

        <p>Jquery</p>

        <p>SilverLight</p>

    </div>

    <input type="button" id="btnSize" value="위 영역 구하기" />

</body>

</html> 






반응형