45장 JQueryCSS 검색된 요소 구하기 (WidthHeight)
|
WidthHeight.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;} </style> <script src="../../jquery-1[1].3.2-vsdoc2.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $('#btnSize').dblclick(function () { var msg = $('#my').width() + "," + $('#my').height(); window.alert(msg); }); }); </script> </head> <body> <div id="my"> <p>Jquery</p> <p>SilverLight</p> </div> <input type="button" id="btnSize" value="위 영역 구하기" /> </body> </html> |