속성설명
clientWidth : Retrieves the width of the object including padding, but not including margin, border, or scroll bar.
offsetWidth : Retrieves the width of the object relative to the layout or coordinate parent, as specified by the offsetParent property.
offsetParent : Retrieves a reference to the container object that defines the offsetTop and offsetLeft properties of the object.
offsetTop : Sets or retrieves the top position of the object in the units specified by the top attribute.
offsetLeft : Sets or retrieves the left position of the object in the units specified by the left attribute.
clientHeight, clientWidth : 실제 웹페이지에 접속한 사용자가 가시적으로 보는 높이와 폭의 값입니다. offsetHeight, offsetWidth : 그 객체를 포함하고 있는 상위객체의 레이아웃 또는 좌표와 관련된 높이와 폭의 값입니다.
Retrieves the width of the object including padding, but not including margin, border, or scroll bar. Syntax Possible Values The property is read-only. The property has no default value. Example This example shows how the clientWidth property and the offsetWidth property measure document width differently. The width of the div is set to 200, and this is the value retrieved by the offsetWidth property, not the clientWidth property. Standards Information There is no public standard that applies to this property. Applies To See Also
똑같은 말이지만
http://msdn2.microsoft.com/en-us/library/ms533566.aspx
관련설명이 있는 msdn을 참고하면 더 좋을듯 하다.
내가 하고 싶은건 현재 윈도우의 크기를 구해서 그 값을 다른 object에 응용해보려는 것이다.
윈도우 크기가 변할때마다 크기를 조정하는 onresize 를 이용해도 되고.
window.settimeout 함수로 계속 호출해도 될거 같다.
적당히 테스트 해보고 좋은쪽으로 ~
HTML
N/A
Scripting
[ iWidth = ] object.clientWidth
iWidth
Integer that receives the width of the object, in pixels.
<DIV ID=oDiv STYLE="overflow:scroll; width:200; height:100"> . . . </DIV>
<BUTTON onclick="alert(oDiv.clientWidth)">client width</BUTTON>
<BUTTON onclick="alert(oDiv.offsetWidth)">offset widthY</BUTTON>
A, ADDRESS, APPLET, B, BDO, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, CUSTOM, DD, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FORM, hn, HTML, I, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, ISINDEX, KBD, LABEL, LEGEND, LI, LISTING, MARQUEE, MENU, META, NOBR, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP Measuring Element Dimension and Location