beginElementAt method

Starts an element's timeline at the specified time.

Syntax

*object.*beginElementAt(parentTime)

Parameters

  • parentTime [in]
    Type: double

    A String that specifies the point along the element's parent timeline at which to start 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's timeline will start at the time specified by the beginElementAt method if beginElementAt is invoked at any time before the parent element reaches that specified time. Otherwise, the element's timeline will start immediately. If beginElementAt is invoked on an element's timeline more than once with a value that is the same or less than the previous value used, it will be ignored.

Examples

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

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

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

<SCRIPT>
function doBegin(){
    <!-- Validate input from user. -->
    if(secondToStart.value<=document.body.currTimeState.activeTime
        || secondToStart.value==null){
        alert('Must be an integer greater than document timer value!\nPlease enter value again.');
        secondToStart.value='';
        secondToStart.focus();
        return;
    }
        t1.beginElementAt(secondToStart.value);
}
</SCRIPT>
<STYLE>
    .time{ behavior: url(#default#time2);}
</STYLE>
</HEAD>

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

<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>

<!-- The time container begins upon document.body.onload. By entering a value
    in the begin element input box, you cause the time container to 
    start over at a certain time in the document.body.currTimeState.activeTime.-->  
<t:excl id="t1" begin="0" class="time" dur="27">
    <DIV id="s1" CLASS="time" STYLE="Color:Red; font-size:20pt;" begin="1" DUR="5">
        First line displayed for 5 seconds.</DIV>
    <DIV id="s2" CLASS="time" STYLE="Color:Green; font-size:20pt;" begin="6" DUR="5">
        Second line displayed for 5 seconds.</DIV>
    <DIV id="s3" CLASS="time" STYLE="Color:Blue; font-size:20pt;" begin="11" DUR="5">
        Third line displayed for 5 seconds.</DIV>
    <DIV id="s4" CLASS="time" STYLE="Color:Orange; font-size:20pt;" begin="16" DUR="5">
        Fourth line displayed for 5 seconds.</DIV>
    <DIV id="s5" CLASS="time" STYLE="Color:Purple; font-size:20pt;" begin="21" DUR="5">
        Last line displayed </DIV>
</t:excl>

Point in document time to start (must be a positive integer):
<INPUT type="number" name="secondToStart" size="3" />
<BUTTON ID="b1" onclick="doBegin()">Click here</BUTTON>
</BODY>
</HTML>

See also

transitionFilter

animate

animateColor

animateMotion

animation

audio

img

media

par

ref

seq

set

time2

video

Reference

beginElement

endElementAt

Conceptual

Introduction to HTML+TIME