ÁöÁ¤µÈ ¼Ó¼ºÀ¸·ÎºÎÅÍ Ç¥Çö½ÄÀ» Á¦°ÅÇÑ´Ù.

Àμö/ÆĶó¸ÞÅÍ
sPropertyName

ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Ç¥Çö½ÄÀÌ Á¦°ÅµÉ ¼Ó¼ºÀÇ À̸§À» ÁöÁ¤ÇÏ´Â ¹®ÀÚ¿­ÀÌ´Ù.

¹Ýȯ°ª

¹Ýȯ°ª bValÀº ¼º°øÀûÀ¸·Î Ç¥Çö½ÄÀÌ Á¦°ÅµÇ¾ú´Â°¡¸¦ ³ªÅ¸³»´Â ºÎ¿ï°ªÀÌ´Ù.

true Ç¥Çö½ÄÀÌ ¼º°øÀûÀ¸·Î Á¦°ÅµÇ¾ú´Ù.
false Ç¥Çö½ÄÀÌ Á¦°ÅµÇÁö ¾Ê¾Ò´Ù.
Ư±â

ÁöÁ¤µÈ ¼Ó¼ºÀ¸·ÎºÎÅÍ Ç¥Çö½ÄÀÌ Á¦°ÅµÈ ÈÄ ¼Ó¼º°ªÀº Á¦°Å Àü ÃÖÁ¾ÀûÀ¸·Î Ç¥Çö½Ä¿¡ ÀÇÇÏ¿© °è»êµÈ °ªÀÌ´Ù. setExpression ¸Þ¼­µå¿¡ ÀÇÇÏ¿© ¼³Á¤µÈ Ç¥Çö½ÄÀ» Á¦°ÅÇϱâ À§ÇÏ¿©, removeExpression ¸Þ¼­µå¸¦ »ç¿ëÇÑ´Ù.

´ÙÀ½ ¹®¹ýÀº CSS ¼Ó¼ºµé(Cascading Style Sheets)°ú ¼Ó¼ºµé¿¡¼­ Ç¥Çö½ÄÀ» Á¦°ÅÇÏ´Â ¹æ½ÄÀ» º¸¿©ÁØ´Ù.

Àû¿ë
°³Ã¼scriptIE
ÂüÁ¶
getExpression, remove, setExpression, recalc

box1Obj + box2Obj : box2Obj.style.width


°á°ú Ç¥½Ãâ

setExpression ¸Þ¼­µå¿Í removeExpression ¸Þ¼­µå·Î div¹Ú½ºÀÇ width ¼Ó¼º Ç¥Çö½ÄÀ» ¼³Á¤ÇÏ°í, Á¦°ÅÇÏ´Â ¿¹Á¦ÀÌ´Ù.

box1Obj <INPUT type=text id=box1Obj value=50 size=3 onchange="showLength.innerText=box3Obj.style.width">+
box2Obj <INPUT type=text id=box2Obj value=50 size=3 onchange="showLength.innerText=box3Obj.style.width"> :
box2Obj.style.width <SPAN id=showLength></SPAN><BR>
<DIV id=box3Obj style="background-color:blue"></DIV><BR>
<SCRIPT>
var sExpress,bVal;
document.onlad=setexp();
function setexp(){
  box3Obj.style.setExpression('width','eval(box1Obj.value)+eval(box2Obj.value)','jscript');
  showLength.innerText=box3Obj.style.width;
}
function getexp(){
  sExpress=box3Obj.style.getExpression('width');
  str='û»ö ¹Ú½ºÀÇ widthÀÇ Ç¥Çö½ÄÀº ' + sExpress + 'ÀÌ°í,<BR>';
  str+='ÀÌ width ¼Ó¼ºÀº °ª ' + box3Obj.style.width+'À» °®´Â´Ù.';
  showA.innerHTML=str;
  showLength.innerText=box3Obj.style.width;
}
function remexp(){
  bVal=box3Obj.style.removeExpression('width');
  showA.innerHTML='Ç¥Çö½ÄÀÌ Á¦°ÅµÇ¾ú³ª? '+bVal;
}
</SCRIPT>
<INPUT type=button id=Button1 value="Ç¥Çö½Ä ³»¿ë" onclick="getexp()">
<INPUT type=button id=Button2 value="Ç¥¼Ç½Ä Á¦°Å" onclick="remexp()">
<INPUT type=button id=Button3 value="Ç¥Çö½Ä »ý¼º" onclick="setexp()"><BR>
<DIV id=showA>°á°ú Ç¥½Ãâ</DIV>