simpleTime参数属性 | DHTML中文手册 |
Retrieves an object's current point along its timeline from zero to its dur value.
dhtml语法
[ itime = ] currtimestate.simpletime
dhtml可能的值
iTime Integer that receives the current point in time along a timeline. The value of this property ranges from 0 to the duration (dur) of the element. If the element has the autoreverse property set to true, the simpleTime property will begin decreasing until it reaches 0. The property is read-only. The property has no default value.
Remarks
This property supersedes the localtime property.
run the example below and note how simpletime increments as the object moves forward, decrements as the object moves backward, then starts over from zero when the repeatcount increments.
DHTML代码范例
This example shows how activetime, segmenttime, and simpletime relate to each other.
<html xmlns:t ="urn:schemas-microsoft-com:time"> <HEAD> <STYLE> .time{behavior: url(#default#time2);} </STYLE> <?IMPORT namespace="t" implementation="#default#time2"> <SCRIPT LANGUAGE="JScript"> window.onload = fnOnLoad; function fnOnLoad() { // Set up a timer to watch the time values. window.setInterval(fnUpdateTimes, 100); } function fnUpdateTimes() { oSimpleTime.innerHTML = " simpleTime: " + (oAnim.currTimeState.simpleTime); oSegmentTime.innerHTML = "segmentTime: " + (oAnim.currTimeState.segmentTime); oActiveTime.innerHTML = " activeTime: " + (oAnim.currTimeState.activeTime); } function fnRepeat() { oRepeatCount.innerHTML = "repeatCount: " + (oAnim.currTimeState.repeatCount + 1); // Add one because repeatCount is zero-based. } </SCRIPT> </HEAD> <BODY> <DIV STYLE="font-family:courier;"> <DIV ID="oRepeatCount">repeatCount: 1</DIV> <DIV ID="oSimpleTime"> simpleTime: 0</DIV> <DIV ID="oSegmentTime">segmentTime: 0</DIV> <DIV ID="oActiveTime"> activeTime: 0</DIV> </DIV> <DIV ID="oDiv" CLASS="time" STYLE="position:absolute; left:50px; top:250px; width:100px; height:100px; background-color:blue;"></DIV> <t:ANIMATEMOTION ID="oAnim" targetElement="oDIV" to="340,40" dur="2" autoReverse="true" repeatCount="5" onrepeat="fnRepeat()" fill="freeze"/> </BODY> </HTML>
是否符合公共标准
This property is a Microsoft extension to Synchronized Multimedia Integration Language (SMIL) .
Applies To
currTimeState
更多语法参考
activetime, segmenttime, Introduction to HTML+TIME