ÁÖ ¹®¼­¿¡ ÀÖ´Â behavior°¡ ÷ºÎµÈ ű×ÀÇ ÂüÁ¶¸¦ ¹ÝȯÇÑ´Ù.

Script [propVal=].propName;
HTML ¾ø½¿
Ư±â

ºñÇìÀ̹ö°¡ ÷ÁÖµÈ ¿¤·¹¸àÆ®ÀÇ ¸ðµç ¼Ó¼ºµé, ¸Þ¼­µåµé, À̺¥Æ®µéÀº ÀÌ HTC(HTML Component) °³Ã¼¸¦ »ç¿ëÇÏ¿© ¿¡ Á¢¼ÓÇÒ ¼ö ÀÖ´Ù. element °³Ã¼´Â HTC ¼Ó¿¡¼­ ¼Ó¼ºµé, ¸Þ¼­µåµé, À̺¥Æ®µéÀÇ À̸§ÀÌ ÁöÁ¤µÈ µðÆúÆ® °³Ã¼ÀÌ´Ù. µû¶ó¼­ À̵éÀº element Å°¿öµå(keyword) »ç¿ë¾øÀÌ Á÷Á¢ÀûÀ¸·Î ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù.

ÂüÁ¶

behavior


¸Þ¼­µå¼³¸í
addBehavior ¿¤·¹¸àÆ®¿¡ behavior¸¦ Ãß°¡ÇÑ´Ù.
createEventObject PUBLIC:EVENT ¿¤·¹¸àÆ®ÀÇ À̺¥Æ® ¹ß»ý ¸Þ¼­µå¿¡ À̺¥Æ® ÄÁÅؽºÆ® Á¤º¸¸¦ Àü´ÞÇϴµ¥ »ç¿ëµÇ´Â event °³Ã¼¸¦ »ý¼ºÇÑ´Ù.

¿¹Á¦

Ŭ¸¯ÇÏ¿© °á°ú ¾ò±â

¿¤·¹¸àÆ®ÀÇ À̺¥Æ®¿¡ ÷ºÎµÈ HTC·Î ¿¤·¹¸àÆ®ÀÇ ±ÛÀÚ»ö color ½ºÅ¸ÀÏ ¼Ó¼ºÀ» 'red'·Î ¼³Á¤ÇÏ°í, cursor ½ºÅ¸ÀÏ ¼Ó¼ºÀ» 'hand'·Î ¼³Á¤ÇÑ´Ù.

<STYLE>.publicShow {behavior:url(../object/exp/myShow.htc)}</STYLE>
<DIV class="publicShow" id="showId" name="showName"
  style="height:2em;border:solid 1 blue;color:blue;background:ffa" onclick="this.doShow()">Ŭ¸¯ÇÏ¿© °á°ú ¾ò±â</DIV>

../object/exp/myShow.htc ÆÄÀÏ ³»¿ë
<PUBLIC:COMPONENT name="doShowCom">
<PUBLIC:METHOD name="doShow" />
<SCRIPT>
function doShow(){
  str='event.type='+event.type+'\n';
  str+='this.id='+this.id+'\n';
  str+='this.name='+this.name+'\n';
  str+='this.nodeName='+this.nodeName+'\n';
  str+='this.className='+this.className+'\n';
  str+='this.style.cssText='+this.style.cssText+'\n';
  prevColor = this.style.color;
  str+='this.style.color='+this.style.color+'\n';
  element.style.color  = 'red';
  element.style.cursor = 'hand';
  str+='element.style.color='+element.style.color+'\n';
  str+='element.style.cursor='+element.style.cursor+'\n';
  alert(str);
}
</SCRIPT>
</PUBLIC:COMPONENT>