endElementAt Method

Internet Development Index

Ends an element's timeline at the specified time.

Syntax

object.endElementAt(iSeconds)

Parameters

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

Return Value

No return value.

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.

Example

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

<!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>
This feature requires Microsoft?Internet Explorer 5.5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

This method is defined in Synchronized Multimedia Integration Language (SMIL) 2.0 Non-Microsoft link.

Applies To

t:TRANSITIONFILTER, t:ANIMATE, t:ANIMATECOLOR, t:ANIMATEMOTION, t:ANIMATION, t:AUDIO, t:IMG, t:MEDIA, t:PAR, t:REF, t:SEQ, t:SET, time2, t:VIDEO

See Also

beginElementAt, endElement, Introduction to HTML+TIME