activeTimeToParentTime Method | DHTML中文手册 |
Converts a value in the element's active timeline to the corresponding point in the parent timeline.
dhtml语法
parentTime = object.activeTimeToParentTime(activeTime)
Parameters
activeTime Required. Integer that specifies a point on the element's active timeline. Legal values range from 0 to activedur.
return value
integer that specifies the point in the parent timeline that corresponds to activetime.
DHTML代码范例
This example uses the activeTimeToParentTime method to compare the value of the element's active timeline to the corresponding point in the parent timeline. To see each element's point in the parent timeline, click its activeTimeToParentTime button.
<HTML XMLNS:t="urn:schemas-microsoft-com:time"> <HEAD> <TITLE>activeTimeToParentTime Method</TITLE> <?IMPORT namespace="t" implementation="#default#time2"> <STYLE> .time{behavior: url(#default#time2);} </STYLE> </HEAD> <BODY ID="b1" TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#FFFFFF" LINK="#000000" VLINK="#808080" ALINK="#000000"> <B>Time container timer:</B> <SPAN class="time" dur="1" repeatCount="indefinite" onrepeat="innerText=parseInt(t1.currTimeState.activeTime);">0</SPAN> <BR> <t:excl id="t1" class="time" dur="10s" autoReverse="true"> <DIV id="div1" style="color:blue" class="time" begin="1s" dur="3s" timeAction="visibility">First Line</DIV> <DIV id="div2" style="color:green" class="time" begin="4s" dur="3s" timeAction="visibility">Second Line</DIV> <DIV id="div3" style="color:red" class="time" begin="7s" dur="3s" timeAction="visibility">Third Line</DIV> </t:excl> <BR> <BUTTON class="time" dur="1" repeatCount="indefinite" onclick="alert('Point in parent timeline: ' + div1.activeTimeToParentTime(t1.currTimeState.activeTime));" onrepeat="innerText='First line\'s activeTimeToParentTime at ' + parseInt(t1.currTimeState.activeTime) + ' seconds';"> First line's activeTimeToParentTime at 0 seconds </BUTTON> <BR> <BUTTON class="time" dur="1" repeatCount="indefinite" onclick="alert('Point in parent timeline: ' + div2.activeTimeToParentTime(t1.currTimeState.activeTime));" onrepeat="innerText='Second line\'s activeTimeToParentTime at ' + parseInt(t1.currTimeState.activeTime) + ' seconds';"> Second line's activeTimeToParentTime at 0 seconds </BUTTON> <BR> <BUTTON class="time" dur="1" repeatCount="indefinite" onclick="alert('Point in parent timeline: ' + div3.activeTimeToParentTime(t1.currTimeState.activeTime));" onrepeat="innerText='Third line\'s activeTimeToParentTime at ' + parseInt(t1.currTimeState.activeTime) + ' seconds';"> Third line's activeTimeToParentTime at 0 seconds </BUTTON> </BODY> </HTML>
是否符合公共标准
This method is a Microsoft extension to Synchronized Multimedia Integration Language (SMIL) .
Applies To
t:TRANSITIONFILTER, t:ANIMATE, t:ANIMATECOLOR, t:ANIMATEMOTION, t:ANIMATION, t:AUDIO, t:EXCL, t:IMG, t:MEDIA, t:PAR, t:REF, t:SEQ, t:SET, time2, t:VIDEO
更多语法参考
introduction to html+time, activetime, parenttimebegin, parentTimeEnd