ÁöÁ¤µÈ ¼Ó¼ºÀÇ Ç¥Çö½ÄÀ» ¹ÝȯÇÑ´Ù.

Àμö/ÆĶó¸ÞÅÍ
sPropertyName
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Ç¥Çö½ÄÀ» Àоî¿Ã ¼Ó¼º À̸§À» ÁöÁ¤ÇÏ´Â ¹®ÀÚ¿­ÀÌ´Ù.
¹Ýȯ°ª

¹Ýȯ°ª vExpressionÀº ¼Ó¼ºÀÇ Ç¥Çö½ÄÀ» ´ëÇ¥ÇÏ´Â °ªÀÌ´Ù.

Ư±â

Àû¿ë
°³Ã¼scriptIE
ÂüÁ¶
style ¸ñ·Ï(CSS Attributes) getExpression, remove, setExpression, recalc

¸Þ¼­µå ¿¹Á¦

û»ö ¹ÙÅÁ¿¡ ¹°»ö ±ÛÀÚ 400 Çȼ¿ ³Êºñ
³ë¶û¹ÙÅÁ¿¡ ³ì»ö ±ÛÀÚ 100 Çȼ¿ ³Êºñ
Ç¥Çö½ÄÀÌ ÀÖ´Â ºÎºÐ
°á°ú Ç¥½Ãâ

CSS¿¡¼­ getExpression ¸Þ¼­µå·Î div °³Ã¼ÀÇ width ¼Ó¼ºÀ» ¹Ýȯ¹Þ´Â´Ù.

<BODY>
<DIV id="div1Obj" style="background-color:blue;color:aqua;width:400">û»ö ¹ÙÅÁ¿¡ ¹°»ö ±ÛÀÚ 400 Çȼ¿ ³Êºñ</DIV>
<DIV id="div2Obj" style="background-color:yellow;color:green;width:200">³ë¶û¹ÙÅÁ¿¡ ³ì»ö ±ÛÀÚ 100 Çȼ¿ ³Êºñ</DIV>
<DIV id="div3Obj"
  style="background-color:red;color:yellow;width:expression(div1Obj.style.pixelWidth+div2Obj.style.pixelWidth)">Ç¥Çö½ÄÀÌ ÀÖ´Â ºÎºÐ</DIV>
<BUTTON onclick=showA.innerHTML=div3Obj.style.getExpression('width');>Ŭ¸¯ÇÏ¿© Ç¥Çö½ÄÀ» º¸¶ó.</BUTTON>
<DIV id=showA>°á°ú Ç¥½Ãâ</DIV>
</BODY>

¸Þ¼­µå ¿¹Á¦ 2





°á°ú Ç¥½Ãâ

setExpression ¸Þ¼­µå·Î û»ö°³Ã¼ÀÇ width ¼Ó¼ºÀ» ¼³Á¤ÇÏ°í, Ç¥Çö½Ä¸¦ Àû¿ëÇϸé À§ µÎ°³Ã¼ÀÇ °ªµéÀ» ÇÕÇÑ °ªÀ¸·Î ³Êºñ¸¦ ¼³Á¤ÇÑ´Ù.

<HTML>
<HEAD>
<SCRIPT>
function doApply(){
  inObjC.style.setExpression('width','eval(inObjA.value)+eval(inObjB.value)','jscript');
}
function doShow(){
  str='û»ö ¹Ú½ºÀÇ ³Êºñ¿¡ ´ëÇÑ Ç¥Çö½ÄÀº <FONT color=blue>'+inObjC.style.getExpression('width')+'</FONT>ÀÌ°í,<BR>'
  str+='±× ³Êºñ °ªÀº(inObjC.style.width)Àº <FONT color=blue>'+inObjC.style.width+'</FONT>ÀÌ´Ù.';
  inObjC.innerText=inObjC.style.width;
  showB.innerHTML=str;
}
</SCRIPT>
</HEAD>
<BODY>
<INPUT type=text id="inObjA" value=40><BR>
<INPUT type=text id="inObjB" value=60><BR>
<INPUT type=text id="inObjC" style="background-color:blue;color:aqua;font-weight:bold"><BR>
<INPUT type=button id="butA" onclick="doApply()" value="Ŭ¸¯ÇÏ¿© Ç¥Çö½Ä Àû¿ëÇÏ°í"><BR>
<INPUT type=button id="butB" onclick="doShow()" value="Ŭ¸¯ÇÏ¿© Ç¥Çö½ÄÀ» º¸¶ó.">
<DIV id=showB>°á°ú Ç¥½Ãâ</DIV>
</BODY>
</HTML>