Safari Developer Library

Developer

WebKitAnimationEvent Class Reference

Options
Deployment Target:

On This Page

WebKitAnimationEvent

WebKitAnimationEvent objects encapsulate information about running animations. More...

Inheritance


  • Event
  • WebKitAnimationEvent

Conforms To


Not Applicable

Import Statement


Not Applicable Not Applicable

Availability


Available in Safari 4.0 and later.
Available in iOS 2.0 and later.
  • animationName Property

    The name of the animation. The value of the CSS -webkit-animation-name property of the animation that caused the event.

    Declaration

    JavaScript

    readonly attribute DOMString animationName

    Availability

    Available in Safari 4.0 and later.

    Available in iOS 2.0 and later.

  • elapsedTime Property

    The duration of the animation, in seconds, since this event was sent, excluding any time the animation is paused. This value is not affected by the value of the CSS -webkit-animation-delay property. If the type of the event is webkitAnimationStart, elapsedTime is 0.

    Declaration

    JavaScript

    readonly attribute double elapsedTime

    Availability

    Available in Safari 4.0 and later.

    Available in iOS 2.0 and later.

  • Initializes a new animation event object.

    Declaration

    JavaScript

    void initWebKitAnimationEvent (in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString animationNameArg, in double elapsedTimeArg);

    Parameters

    typeArg

    The type of event. See Types of Animation Events for possible values.

    canBubbleArg

    Determines whether the event can bubble. Pass true if it can bubble; otherwise, false.

    cancelableArg

    Determines whether the event’s default action can be prevented. Pass true if it can be prevented; otherwise, false.

    animationNameArg

    The name of the animation associated with this event.

    elapsedTimeArg

    The duration of the animation, in seconds, since the event was sent.

    Discussion

    You use this method to initialize the value of a WebKitTransitionEvent object that is created through the DocumentEvent interface. This method can only be invoked before the WebKitTransitionEvent object is dispatched via the dispatchEvent method (although it can be invoked multiple times during that phase, if necessary). If it is invoked multiple times, the final invocation takes precedence.

    Availability

    Available in Safari 4.0 and later.

    Available in iOS 2.0 and later.