REPEATCOUNT Attribute | repeatCount参数属性 | DHTML中文手册 |
Sets or retrieves the number of times an element's timeline repeats.
The begin
dhtml语法
HTML <ELEMENT REPEATCOUNT = vRepetitions... > Scripting object.repeatCount(time) [ = vRepetitions ]
DHTML可能的值
vRepetitions Variant that specifies or receives one of the following values.
indefinite Timeline repeats indefinitely. repetitions Floating-point number or integer greater than 0 that specifies how many times the timeline repeats. 1 Default. Timeline runs only once. The property is read/write. The property has a default value of 1.
Remarks
This property supersedes the repeat property exposed by the time behavior.
if the repeatcount property is a floating-point number, the element's timeline multiplies the fractional amount by the simple duration (simpledur) on the last iteration. for example, a t:seq with a simpledur of 10 seconds and a repeatcount of 2.5 would result in a sequence that plays for a total of 25 seconds. in this case, the sequence completes two full iterations, and the last iteration ends after playing for 5 seconds (10 seconds x .5).
the current iteration of a repeat loop can be obtained on an active timeline using the repeatcount property exposed by the currtimestate object.
Examples
The following example shows how to repeat a parallel timeline container using the REPEATCOUNT attribute.
<HTML> <HEAD> <TITLE>repeatCount Property</TITLE> <STYLE> .time{ behavior: url(#default#time2);} </STYLE> </HEAD> <BODY TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#FFFFFF" LINK="#000000" VLINK="#808080" ALINK="#000000"> <P>Three paragraphs will be shown for three seconds each, and the entire process will be repeated three times. <SPAN ID="parent" CLASS=time BEGIN="0" DUR="9" TIMECONTAINER="PAR" REPEATCOUNT="3" TIMEACTION="display"> <SPAN ID="span1" CLASS=time STYLE="COLOR:Red;" BEGIN="0" DUR="3" TIMEACTION="visibility"> <H3>Paragraph 1</H3> <P>This is paragraph number one.</P> </SPAN> <SPAN ID="span2" CLASS=time STYLE="COLOR:Blue;" BEGIN="3" DUR="3" TIMEACTION="visibility"> <H3>Paragraph 2</H3> <P>This is paragraph number two.</P> </SPAN> <SPAN ID="span2" CLASS=time STYLE="COLOR:Green;" BEGIN="6" DUR="3" TIMEACTION="visibility"> <H3>Paragraph 3</H3> <P>This is paragraph number three.</P> </SPAN> </SPAN> </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.The example below uses the REPEATCOUNT attribute to repeat a transition on a div. the repeatcount attribute inside the t:transitionfilter element is set to indefinite. however, the div below will only repeat for the duration of the div (in this case seven seconds).
<HTML XMLNS:t = "urn:schemas-microsoft-com:time"> <HEAD> <STYLE> .time {behavior: url(#default#time2);} </STYLE> <?import namespace = t urn = "urn:schemas-microsoft-com:time" implementation = "#default#time2" /> </HEAD> <BODY> <t:TRANSITIONFILTER REPEATCOUNT="indefinite" TYPE="barnDoorWipe" DUR="3" TARGETELEMENT="oDiv1"/> <!-- The REPEATCOUNT property inside the transitionFilter is set to indefinite. However, the DIV below will only repeat for the duration of the DIV (in this case seven seconds). --> <DIV CLASS="time" ID="oDiv1" dur="7" style="position:relative; left:20px; width:420px; height:100px; background-image:url(ART_time_progress.gif); background-repeat: no-repeat;"> </DIV> </BODY> </HTML>
是否符合公共标准
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:IMG, t:MEDIA, t:PAR, t:REF, t:SEQ, time2, t:VIDEO, t:TRANSITIONFILTER
更多语法参考
introduction to html+time, repeatDur