Share via


simpleDur property

Gets the duration of a repeat iteration.

Syntax

JScript
dur = object.simpleDur

 

Property values

Type: Integer

A floating-point that receives the amount of time in each repeat iteration of a element timeline.

Remarks

The simpleDur property includes the additional time required to play the element if the autoReverse property is set to true.

Examples

This example uses the simpleDur property to get the duration of a repeat iteration.

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/behaviors/simpledur.htm

<HTML XMLNS:t ="urn:schemas-microsoft-com:time">
<HEAD>
<?IMPORT namespace="t" implementation="#default#time2">

<STYLE>
    .time{ behavior: url(#default#time2);}
</STYLE>

<SCRIPT LANGUAGE="JScript">
function fnRepeat()
{
    oCount.innerText = "Current iteration: " + 
        (oAnim.currTimeState.repeatCount + 1);
        // Add one because repeatCount is zero-based.
}
function getSimpleDur()
{
    s1.innerHTML = "Duration of each repeat iteration:&nbsp;" +
        (oAnim.currTimeState.simpleDur) + ' seconds.';
}
</SCRIPT>
</HEAD>

<BODY TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#FFFFFF"
    LINK="#000000" VLINK="#808080" ALINK="#000000">
<B>Timer:</B>
<SPAN id="Timer" class="time" dur=".01" repeatCount="indefinite" fill="hold"
    onrepeat="innerText=parseInt(document.body.currTimeState.activeTime);">0
    </SPAN>
<BR><BR>

<DIV ID="oCount">Current iteration: 1</DIV>
<SPAN id="s1">Duration of each repeat iteration:</SPAN>

<DIV ID="oDiv" CLASS="time" STYLE="position:relative;top:25px;left:50px;
    height:100;width:100px;background-color:blue;"></DIV>

<t:ANIMATEMOTION ID="oAnim" targetElement="oDIV" to="325,0"
    begin="0; indefinite;" dur="2" autoReverse="true" repeatCount="5"
    onrepeat="fnRepeat()"/>

<BR><BR>
<BUTTON id="b1" onclick="getSimpleDur()">Click for the duration of each 
    repeat iteration</BUTTON>
<BUTTON id="b2" onclick="oAnim.beginElement();">Click to restart</BUTTON>
</BODY>
</HTML>

See also

currTimeState

Reference

activeDur

dur

mediaDur

repeatDur

segmentDur

Conceptual

Introduction to HTML+TIME