DUR Attribute | dur Property | Internet Development Index |
Sets or retrieves a value indicating the amount of time the element remains active or displayed.
Syntax
HTML <ELEMENT DUR = sTime... > Scripting object.dur [ = sTime ]
Possible Values
sTime String that specifies one of the following values:
indefinite Element remains active on the timeline for an indefinite amount of time. duration Amount of time the element remains active or displayed. The time must be specified as described in Time Formats. The property is read/write. The property has no default value.
Remarks
Any media tag (img, media, etc.) has a default DUR value based on the type of media. For movies, audio, and animated GIFs, the default DUR is built into the media and can be determined by calling the mediaDur property. For static images, the default DUR value is zero seconds. When used with any other type of element, the default value for DUR is indefinite.
The DUR attribute is a value relative to the value of the element's BEGIN attribute. By contrast, the END attribute represents an absolute value along the parent element's timeline starting at 0 seconds. Do not use the DUR attribute on the same element as the END attribute.
For Microsoft?DirectMusic? if you set dur to be 0 on a playing segment, it will stop playing at the end of the next measure.
The dur property is read-only on the playItem object.
Example
This example uses the DUR attribute to display lines of text for different amounts of time.
<HTML XMLNS:t ="urn:schemas-microsoft-com:time"> <HEAD> <STYLE> .time{ behavior: url(#default#time2);} </STYLE> </HEAD> <BODY BGCOLOR="white"> <SPAN CLASS=time STYLE="COLOR:Red;" BEGIN="0" DUR="5" TIMEACTION="visibility"> <H3>Paragraph 1</H3> <P>This is paragraph number one. It displays for five seconds.</P> </SPAN> <SPAN CLASS=time STYLE="COLOR:Blue;" BEGIN="0" DUR="10" TIMEACTION="visibility"> <H3>Paragraph 2</H3> <P>This is paragraph number two. It displays for ten seconds.</P> </SPAN> <SPAN CLASS=time STYLE="COLOR:Green;" BEGIN="0" DUR="indefinite" TIMEACTION="visibility"> <H3>Paragraph 3</H3> <P>This is paragraph number three. It displays indefinitely.</P> </SPAN> </BODY> </HTML>
Standards Information
This property is defined in Synchronized Multimedia Integration Language (SMIL) 2.0 .
Applies To
t:ANIMATE, t:ANIMATECOLOR, t:ANIMATEMOTION, t:ANIMATION, t:AUDIO, t:EXCL, t:IMG, t:MEDIA, t:PAR, playItem, playList, t:REF, t:SEQ, t:SET, time2, t:VIDEO
See Also
Introduction to HTML+TIME, activeDur, mediaDur, repeatDur, segmentDur, simpleDur