tanimateColor¿¡¼­ ÁøÇà¿¡ µû¸¥ Á¡ÁøÀû º¯È¯ÀÇ ¸ðµå¸¦ ¹ÝȯÇϰųª ¼³Á¤ÇÑ´Ù.

Àμö
: (¼Ó¼º ¹®ÀÚ¿­)
¼Ó¼º°ªÀº tanimateColor¿¡¼­ ÁøÇà¿¡ µû¸¥ Á¡ÁøÀû º¯È¯ÀÇ ¸ðµå¸¦ ³ªÅ¸³»´Â ¹®ÀÚ¿­ÀÌ´Ù.

discrete ¾Ö´Ï¸ÞÀ̼ÇÀº Á¡ÁøÀûÀÌ ¾Æ´Ï°í ÇÑ °ª¿¡¼­ ´Ù¸¥ °ªÀ¸·Î Á÷Á¢ º¯°æµÈ´Ù.
linear µðÆúÆ®À̸ç, ¾Ö´Ï¸ÞÀ̼ÇÀº Á¡Áø¼º ±â´ÉÀ» ´Ü¼ø Á÷¼±»ó °è»êÀ¸·Î Ç¥ÇöÇÑ´Ù. t:ANIMATECOLOR ¼Ó¼ºÀÇ À¯È¿ÇÑ °ªÀº 16Áø¼ö »ö»ó°ªÀ̳ª ±× »ö»óÀ» Å°¿öµåÀÌ´Ù.
paced ¾Ö´Ï¸ÞÀ̼ÇÀº Àü Á¡ÁøÀû º¯È¯À» ÀÏÁ¤ÇÑ °£°ÝÀ¸·Î ÇÑ´Ù. ÀÌ´Â Á÷¼±Àû ¼öÄ¡ ¹üÀ§ÀÇ ¾ÖÆ®¸®ºäÆ®°ª¸¸ Áö¿øÇÏ°í ÁöÁ¤ÇÑ ³Êºñ³ª ³ôÀÌ °°Àº µÎ ÁöÁ¡°£ÀÇ °Å¸®¸¦ °è»êÇÑ´Ù. À¯È¿ÇÑ °ªÀº 16Áø¼ö »ö»ó°ªÀ̳ª ±× »ö»óÀ» Å°¿öµåÀÌ´Ù.
spline À°¸éü cubic Bezier spline¿¡ ÀÇÇÏ¿© Á¤ÀÇµÈ ½Ã°£ ±â´É¿¡ µû¶ó ´ÙÀ½ Á¡ÁøÀû °ªÀ¸·Î ¾Ö´Ï¸ÞÀ̼ÇÀÌ °è»êµÈ´Ù. ÀÌ ÆÇÀÇ Á¡µéÀº keyTimes ¼Ó¼ºÀ¸·Î Á¤ÀÇÇÏ°í, °¢ °£°Ý Á¦¾îÁ¡Àº keySplines ¼Ó¼ºÀ¸·Î ¼³Á¤ÇÑ´Ù.

ÀÌ ¼Ó¼ºÀº ÀбâÀü¿ë ȤÀº Àбâ/¾²±â·Î µðÆúÆ®°ªÀº linearÀÌ´Ù.

Ư±â

calcMode ¾ÖÆ®¸®ºäÆ®´Â Á¡ÁøÀû º¯È¯¿¡¼­ to, by, from°ú values ¾ÖÆ®¸®ºäÆ®µéÀÇÀÇ °ªÀ» ¾î¶»°³ °áÁ¤Çϴ°¡¸¦ ÁöÁ¤Çϴµ¥ »ç¿ëµÈ´Ù.

Àû¿ë
°³Ã¼scriptHTML±Ô°ÝIE
ÂüÁ¶
HTML+time begin by clacMode dur fill from targetElement to values »ö»óÇ¥

outerDiv(tani1):
innerDiv(tani2):

°á°ú Ç¥½Ãâ

t:ANIMATECOLOR ¿¤·¹¸àÆ®´ÂDIV ¿¤·¹¸àÆ®ÀÇ backgroundColor ¼Ó¼º°ªÀ» ¼³Á¤ÇÑ ¸ðµå¿¡ µû¶ó Ãʵ¿¾È º¯È¯½ÃŲ´Ù.
calcMode ¼Ó¼ºÀÌ values °ª¿¡ÀÖ´Â »ö»óµé¿¡µû¶ó

<HTML xmlns:t="urn:schemas-microsoft-com:time">
<HEAD>
<STYLE>.time {behavior: url(#default#time2);}</STYLE>
<IMPORT namespace="t" implementation="#default#time2">
<SCRIPT>
function setMode(io,jobType){
  if (!jobType) jobType='linear';
  if (io=='out'){
    tani1.calcMode=jobType;
    if (jobType=='spline'){
      tani1.keySplines='0 .2 .2 .5;.2 .5 .2 .5;.5 .5 .2 .7;.5 .7 .5 1';
      tani1.keyTimes='.2;.5;.7;1';
      innerDIV.style.visibility='hidden';
    } else tani1.keySplines=tani1.keyTimes='';
  } else {
    tani2.calcMode=jobType;
    if (jobType=='spline'){
      tani2.keySplines='0 1 .5 1;.5 1 0 1';
      tani2.keyTimes='0;.5;1';
    } else tani2.keySplines=tani2.keyTimes='';
  }
  showAll();
  tani1.beginElement();
  tani2.beginElement();
}

function showAll(){
  outerDIV.innerText=(tani1.calcMode);
  innerDIV.innerText=(tani2.calcMode);
  str='tani1.calcMode=<FONT color=red><B>'+tani1.calcMode+'</B></FONT><BR>';
  str+='tani1.targetElement='+tani1.targetElement+'<BR>';
  str+='tani1.begin='+tani1.begin+'<BR>';
  str+='tani1.dur='+tani1.dur+'<BR>';
  str+='tani1.attributeName='+tani1.attributeName+'<BR>';
  str+='tani1.values='+tani1.values+'<BR>';
  str+='tani1.keySplines='+tani1.keySplines+'<BR>';
  str+='tani1.keyTimes='+tani1.keyTimes+'<BR><BR>';
  str+='tani2.calcMode=<FONT color=red><B>'+tani2.calcMode+'</B></FONT><BR>';
  str+='tani2.targetElement='+tani2.targetElement+'<BR>';
  str+='tani2.begin='+tani2.begin+'<BR>';
  str+='tani2.dur='+tani2.dur+'<BR>';
  str+='tani2.attributeName='+tani2.attributeName+'<BR>';
  str+='tani2.values='+tani2.values+'<BR>';
  str+='tani2.keySplines='+tani2.keySplines+'<BR>';
  str+='tani2.keyTimes='+tani2.keyTimes+'<BR>';
  showA.innerHTML=str;
}
</SCRIPT>
</HEAD>
<BODY>
<T:PAR id="parObj" begin="0" dur="13" onbegin="showAll()" fill="hold">
</T:PAR>
<T:ANIMATECOLOR id="tani1" targetElement="outerDIV" begin="2" dur="8"
  attributeName="background-color" values="#FF0000;#0000FF;#32CD32;#FFFF00" calcMode="linear" fill="hold" />
<DIV id="outerDIV" class="time" style="font-size:18;position:relative;top:0;left:0;width:600;height:200;
    background-color:#00FF00;padding:10;border:solid 1 blue;"></DIV>
<T:ANIMATECOLOR id="tani2" targetElement="innerDIV" begin="2" dur="8"
  attributeName="background-color" values="#FF0000;#0000FF;#32CD32;#FFFF00" calcMode="paced" fill="hold" />
</T:PAR>
<DIV id="innerDIV" class="time" style="font-size:18;position:relative;top:-175;left:100;width:400;height:150;
    background-color:#ffffff;padding:10;border:dotted 3 red;"></DIV>

<P style="position:relative;top:-150">
<SPAN style=width:110>outerDiv(tani1)</SPAN>:
<BUTTON onclick="setMode('out','linear')">linear ½ÃÀÛ</BUTTON>
<BUTTON onclick="setMode('out','discrete')">discrete ½ÃÀÛ</BUTTON>
<BUTTON onclick="setMode('out','paced')">paced ½ÃÀÛ</BUTTON>
<BUTTON onclick="setMode('out','spline')">spline ½ÃÀÛ</BUTTON><BR>

<SPAN style=width:110>innerDiv(tani2)</SPAN>:
<BUTTON onclick="setMode('in','linear')">linear ½ÃÀÛ</BUTTON>
<BUTTON onclick="setMode('in','discrete')">discrete ½ÃÀÛ</BUTTON>
<BUTTON onclick="setMode('in','paced')">paced ½ÃÀÛ</BUTTON>
<BUTTON onclick="setMode('in','spline')">spline ½ÃÀÛ</BUTTON>
<DIV id=showA style=position:relative;top:-150>°á°ú Ç¥½Ãâ</DIV>
</P>
</BODY>
</HTML>

t:ANIMATECOLORÀÇ from, ¼Ó¼º ¿¹Á¦

¿ÜºÎ DIV


³»ºÎ DIV

°á°ú Ç¥½Ãâ

µÎ°³ÀÇ t:ANIMATECOLOR ¿¤·¹¸àÆ®°¡ °¢°¢ div ¿¤·¹¸àÆ®ÀÇ backgroundColor¸¦ º¯°æ½ÃÅ°¸ç, ³»ºÎ DIVÀº ¹è°æ»öÀÌ ¿¬ÃÊ·Ï¿¡¼­ ³ë¶ûÀ¸·Î, DIV ¿ÜºÎ Àº ³ë¶û¿¡¼­ ¿¬ÃÊ·ÏÀ¸·Î ¾Ö´Ï¸ÞÀ̼ǵȴÙ.

<HTML xmlns:t="urn:schemas-microsoft-com:time">
<HEAD>
<STYLE>.time {behavior: url(#default#time2);}</STYLE>
<IMPORT namespace="t" implementation="#default#time2">
<SCRIPT>
function showAll2(obj){
  objid=obj.id;
  str=objid+'.attributeName='+obj.attributeName+'<BR>';
  str+=objid+'.from='+obj.from+'<BR>';
  str+=objid+'.to='+obj.to+'<BR>';
  str+=objid+'.targetElement='+obj.targetElement+'<BR>';
  str+=objid+'.begin='+obj.begin+'<BR>';
  str+=objid+'.dur='+obj.dur+'<BR>';
  str+=objid+'.fill='+obj.fill+'<BR>';
  str+=objid+'.calcMode='+obj.calcMode+'<BR>';
  if (objid=='ac1Obj') str+='outerDiv2.style.backgroundColor='+outerDiv2.style.backgroundColor+'<BR>';
  else str+='innerDiv2.style.backgroundColor='+innerDiv2.style.backgroundColor+'<BR>';
  showB.innerHTML=str;
}
</SCRIPT>
</HEAD>
<BODY>
<T:PAR id="parObj2" begin="0" dur="15" fill="hold">
<T:ANIMATECOLOR id="ac1Obj" attributeName="background-color" from="yellow" to="lightgreen"
  targetElement="outerDiv2" begin="0" dur="5" fill="hold"/>
<DIV id="outerDiv2" class="time"
  style="font-size:18;left:100;border:solid 3 red;position:absolute;width:400;height:200;
    background-color:red;text-align:center;padding:9">¿ÜºÎ DIV</DIV><BR><BR>

<T:ANIMATECOLOR id="ac2Obj" attributeName="background-color" from="lightgreen" to="yellow"
  targetElement="innerDiv2" begin="0" dur="5" fill="hold"/>
</T:PAR>
<DIV id="innerDiv2" class="time"
  style="font-size:18;left:150;border:dotted 3 blue;position:absolute;width:300;height:100;
    background-color:blue;text-align:center;padding:9">³»ºÎ DIV</DIV>
<P style=margin-top:190></P>
<BUTTON onclick="parObj2.beginElement()">´Ù½Ã ½ÃÀÛ</BUTTON>
<BUTTON onclick="showAll2(ac1Obj)">¿ÜºÎ ³»¿ë º¸±â</BUTTON>
<BUTTON onclick="showAll2(ac2Obj)">³»ºÎ ³»¿ë º¸±â</BUTTON>
<DIV id=showB>°á°ú Ç¥½Ãâ</DIV>
</BODY>
</HTML>