timeParent property

Gets the parent time container element of the current element.

Syntax

JScript
parent = object.timeParent

 

Property values

Type: Object

the parent time container element.

Remarks

The timeParent property returns an ITIMEElement object, which can be used to get timing properties and to navigate the Introduction to HTML+TIME object model. It does not return an IHTMLElement, which is used to get HTML properties, such as id, style, and so on.

Examples

This example demonstrates how to get the duration (dur) of the parent time container element and how to set the duration (dur) from indefinite to 30 seconds.

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


...
<SCRIPT>
window.onload = fnOnLoad;
function fnOnLoad()
{
    // Set up a timer to watch the time values.
    window.setInterval(fnUpdateTimes,100);
}
function fnUpdateTimes()
{
    oParent = t1.timeParent;
    span1.innerText = oParent.dur;
}
</SCRIPT>
...
<DIV id="div1" class="time"
    style="position:relative;top:25px;left:100px;height:100px;width:100px;
        background-color:blue;"></DIV>
<!-- t:EXCL is the parent time container for the t1 element. -->
<t:EXCL class="time" begin="0" dur="indefinite">
	<!-- Child element of t:EXCL time container. -->
    <t:ANIMATEMOTION id="t1" targetElement="div1" to="375,0" begin="0" dur="3"
        autoReverse="true" repeatCount="indefinite"/>
</t:EXCL>
...
<BUTTON onclick="oParent.dur='30s';">Set parent duration</BUTTON>

See also

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

 

 

Show: