Export (0) Print
Expand All
end
src
src
URL
Expand Minimize
This topic has not yet been rated - Rate this topic

segmentTime Property

This topic documents a feature of HTML+TIME 2.0, which is obsolete as of Windows Internet Explorer 9.

Gets the current point in time along a segment of time.

Syntax

[ iTime = ] currTimeState.segmentTime

Possible Values

iTime Integer that receives the current point in time along a segment of time, in seconds. The value of this property ranges from zero to segmentDur.

The property is read-only. The property has no default value.

Remarks

The segmentTime property contains the time elapsed since the beginning of the current iteration through an object timeline. This includes time spent in reverse mode. The following example shows how segmentTime accumulates as the timeline goes forward and backward, and then starts over when the repeatCount increments.

Example

This example also shows how activeTime, segmentTime, and simpleTime relate to each other.


<HTML XMLNS:t ="urn:schemas-microsoft-com:time">
<HEAD>
<TITLE>segmentTime Example</TITLE>

<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 = "&nbsp;simpleTime:&nbsp;" + 
        (oAnim.currTimeState.simpleTime);
						  
    oSegmentTime.innerHTML = "segmentTime:&nbsp;" + 
        (oAnim.currTimeState.segmentTime);
						   
    oActiveTime.innerHTML = "&nbsp;activeTime:&nbsp;" + 
        (oAnim.currTimeState.activeTime);
}

function fnRepeat()
{
    oRepeatCount.innerHTML = "repeatCount:&nbsp;" + 
        (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">&nbsp;simpleTime:&nbsp;0</DIV>
<DIV ID="oSegmentTime">segmentTime:&nbsp;0</DIV>
<DIV ID="oActiveTime">&nbsp;activeTime:&nbsp;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>

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/behaviors/htmltime/animations/timelines.htm

Applies To

currTimeState

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.