Fires when the timeline repeats on an element, beginning with the second iteration.
Syntax
Inline HTML <ELEMENT onrepeat = "handler" ... > All platforms Event property object.onrepeat = handler JScript (compatible with ECMA 262 language specification) only Named script <SCRIPT FOR = object EVENT = onrepeat> Internet Explorer only
Remarks
Bubbles No Cancels No To invoke Set the repeat property to a value greater than 1. Default action Calls the associated event handler. The event fires once for each repetition of the timeline, excluding the first full cycle. Therefore, the onrepeat event fires repeat1 times unless it is stopped by other dependencies before completion. This event fires only if the repeat or repeatDur property is set directly on the element. This event does not fire on child elements that have the repeat or repeatDur property set only on their parent elements.
Event Object Properties
Although event handlers in the Dynamic HTML (DHTML) Object Model do not directly receive parameters, the handler can query the event object for data. For a list of properties of the event object relevant to an onrepeat event handler, click the following link.
iteration Retrieves the current iteration of the timeline's repeat cycle. srcElement Retrieves the object that fired the event. type Retrieves the event name from the event object. To access the iteration value, use the getAttribute method on the window.event object.
Example
This example displays a message box that indicates the current repeat iteration every time the onrepeat event fires on a timeline.
Sample Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <STYLE> .time { behavior: url(#default#time);} </STYLE> </HEAD> <BODY BGCOLOR="white"> <SPAN ID="parent" CLASS=time t:BEGIN="0" t:DUR="6" t:REPEAT="4" t:TIMELINE="par" t:TIMEACTION="display" onrepeat="alert('Current iteration: ' + window.event.getAttribute('iteration'));"> <SPAN CLASS=time t:BEGIN="0" t:DUR="2">This text will be displayed for two seconds.</SPAN><BR> <SPAN CLASS=time t:BEGIN="3" t:DUR="4">This text will be displayed for four seconds.</SPAN> </SPAN> </BODY> </HTML>
Applies To
animation, audio, img, media, par, seq, time, video