Safari Reference Library Apple Developer
Search

WebKitTransitionEvent Class Reference

Inherits from
Event
Availability
Available in Safari 4.0 and later.
Available in iPhone OS 2.0 and later.
Companion guide

Overview

WebKitTransitionEvent objects provide information about CSS transitions specified using the -webkit-transition property. An event is sent at the end of a transition for each CSS property in the transition. Each event contains the name of the CSS property and duration of the transition. You can use these events to perform some action that starts at the end of a transition.

Types of Transition Events

The only possible string value for a transition event’s type property is:

webKitTransitionEnd

Sent when a transition completes.

Tasks

Accessing Properties

Initializing

Properties

elapsedTime

The duration of the transition, in seconds, since this event was sent. This value is not affected by the value of the CSS -webkit-transition-delay property.

readonly attribute double elapsedTime;
Availability

propertyName

The name of the CSS property associated with the transition.

readonly attribute DOMString propertyName;
Availability

Methods

initWebKitTransitionEvent

Initializes a new transition event object.

void initWebKitTransitionEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString propertyNameArg, in double elapsedTimeArg);

Parameters
typeArg

The type of event.

Possible values for this argument are described in “Types of Transition Events.” This type of event can bubble and be canceled. Its propertyName property is always set.

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.

propertyNameArg

The name of the CSS property associated with this event.

elapsedTimeArg

The duration of the transition, 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 iPhone OS 2.0 and later.



Last updated: 2010-02-24

Did this document help you? Yes It's good, but... Not helpful...