°³Ã¼ÀÇ ÃÖ»óÀ§ Ȱ¼º ¸ðµç ½Ã°£ ÀÚ½Ä ¿¤·¹¸àÆ®ÀÇ Ä÷º¼Ç ¹è¿º¯¼öÀ» ÂüÁ¶ÇÑ´Ù.
t:PAR ¿¤·¹¸àÆ®³ª ½Ã°£ ¿ë±â¿Í °°Àº BODY ÀÇ ºñÇìºñ¾î¿¡ Àû¿ëµÇ¹Ç·Î activeElements Ä÷º¼ÇÀ» Àû¿ëÇÏ¿© BODY °³Ã¼ÀÇ ÇöÀç Ȱ¼ºÈµÇ¾î ÀÖ´Â ¹®¼ÀÇ ÃÖ»óÀ§ ÀÚ½Ä ½Ã°£ °³Ã¼µéÀÇ ¹è¿º¯¼ö¸¦ ¹Ýȯ¹ÞÀ» ¼ö ÀÖ´Ù.
´Ù¸¥ DHTML(Dynamic HTML) Ä÷º¼Çµé¿¡¼¿Í ¸¶Âù°¡Áö·Î index·Î activeElements Ä÷º¼ÇÀÇ °³º° °³Ã¼¸¦ ÂüÁ¶ÇÒ ¼ö ÀÖÀ¸³ª, Ȱ¼ºÀÌ ºü¸¥ ¼Óµµ·Î º¯ÈµÇ¹Ç·Î À¯È¿ÇÏ´ø index·Î È£ÃâÇÏ´õ¶óµµ ºÒȰ¼ºµÈ °³Ã¼µé ¶§¹®¿¡ ¿À·ù°¡ ¹ß»ýµÇ±â ½±´Ù. ¿À·ù¸¦ ¹æÁöÇϱâ À§ÇÏ¿© 0¿¡¼ ºÎÅÍ Ä÷º¼ÇÀÇ ±æÀ̱îÁö for ·çÇÁ ¹®ÀåÀ» »ç¿ëÇϰųª Enumerator °³Ã¼, ȤÀº VBScript For Each...Next ¹®ÀåÀ» »ç¿ëÇÏ´Â °ÍÀÌ ¾ÈÀüÇÏ´Ù.
| °³Ã¼ | script | HTML | ±Ô°Ý | IE |
|---|
ÀÌ Ä÷º¼ÇÀº (¿µ¹®) SMIL 2.0(Synchronized Multimedia Integration Language)¿¡ È®ÀåÇÑ °ÍÀÌ´Ù.
HTML+time, timeAll, timeChildren¼³¸íÀ» À§ÇÑ ¿¹Á¦
³ì»ö ¹®ÀÚ¿ÀÌ ºñȰ¼º ¿¤·¹¸àÆ®ÀÌ°í ½Ã°£¿¡µû¶ó 1ÃÊ °£°ÝÀ¸·Î º¯ÈµÈ´Ù.
<STYLE>
.time{behavior:url(#default#time2);color:green;border:solid 1 gray;padding:3}
</STYLE>
<XML:namespace prefix="t"/>
<SCRIPT>
function showActive(){
actElemCol=new Enumerator(timeObj.activeElements);
str=numb='';
for(; !actElemCol.atEnd(); actElemCol.moveNext()){
numb++;
str=str+' <'+actElemCol.item().tagName+' id='+actElemCol.item().id+'>';
}
str+='\nȰ¼º ¿¤·¹¸àÆ® '+numb+' °³';
showA.innerText='ÇöÀç Ȱ¼º ¿¤·¹¸àÆ®µé'+str;
}
</SCRIPT>
<t:PAR id="timeObj" class="time" timeaction="none" dur="9" repeatcount="indefinite">
<SPAN id="obj1" class="time" style="color:red;" timeaction="style" begin="0" dur="4">¹®ÀÚ¿ 1</SPAN>
<SPAN id="obj2" class="time" style="color:pink;" timeaction="style" begin="1" dur="4">¹®ÀÚ¿ 2</SPAN>
<SPAN id="obj3" class="time" style="color:navy;" timeaction="style" begin="2" dur="4">¹®ÀÚ¿ 3</SPAN>
<SPAN id="obj4" class="time" style="color:blue;" timeaction="style" begin="3" dur="4">¹®ÀÚ¿ 4</SPAN>
<SPAN id="obj5" class="time" style="color:brown;" timeaction="style" begin="4" dur="4">¹®ÀÚ¿ 5</SPAN>
<SPAN id="obj6" class="time" style="color:violet;" timeaction="style" begin="5" dur="4">¹®ÀÚ¿ 6</SPAN>
</t:PAR><BR><BR>
<BUTTON style="width:200" onclick="showActive();">Ȱ¼º ¿¤·¹¸àÆ® º¸±â</BUTTON>
<DIV id=showA style=font-size:16;>°á°ú Ç¥½Ãâ</DIV>