endElementAt method

Ends an element's timeline at the specified time.

Syntax

object.endElementAt(parentTime)

Parameters

parentTime [in]

Type: double

A String that specifies the point along the element's parent timeline at which to stop playing the element.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The element will stop playing at the point in its timeline specified by the endElementAt method if endElementAt is invoked at any time before the parent element reaches that specified time. Otherwise, the element will continue playing until it reaches the end of its timeline.

Examples

This example shows how to use the endElementAt method to end an element's timeline at a specified time.

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



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML XMLNS:t="urn:schemas-microsoft-com:time">
<HEAD>
<SCRIPT>
function doEnd(){
    <!-- Validate input from user. -->
    if(secondToEnd.value<=document.body.currTimeState.activeTime || secondToEnd.value==null)
    {
        alert('Must be an integer greater than the time container timer value!\nPlease enter value again.');
    }
    else
    {
        t1.endElementAt(secondToEnd.value);
    }
}
</SCRIPT>
<STYLE>
	.time { behavior: url(#default#time2) }
</STYLE>
<?IMPORT namespace="t" implementation="#default#time2">
</HEAD>

<BODY>

<B>Time Container Timer:</B>
<SPAN id="Timer" class="time" dur=".01"  repeatCount="indefinite" fill="hold"
onrepeat="innerText=parseInt(t1.currTimeState.activeTime);">0</SPAN>
<BR><BR>

<t:excl ID="t1" repeatDur="indefinite"> 
	<DIV ID="div1" CLASS="time" BEGIN="0" DUR="5">First line displayed for 5 seconds.</DIV>
	<DIV ID="div2" CLASS="time" BEGIN="5" DUR="5">Second line displayed for 5 seconds.</DIV>
</t:excl>

<BR>
Point in document time to end (must be a positive integer):<BR> 
<INPUT type="number" name="secondToEnd" size="3" />
<BUTTON ID="b1" onclick="doEnd()">Submit Time</BUTTON>

</BODY>
</HTML>


See also

transitionFilter
animate
animateColor
animateMotion
animation
audio
img
media
par
ref
seq
set
time2
video
Reference
beginElementAt
endElement
Conceptual
Introduction to HTML+TIME

 

 

Show: