WebKitTransitionEvent Class Reference
| Inherits from | Event |
| Availability | Available in Safari 4.0 and later. Available in iOS 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:
webKitTransitionEndSent when a transition completes.
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
- Available in Safari 4.0 and later.
- Available in iOS 2.0 and later.
propertyName
The name of the CSS property associated with the transition.
readonly attribute DOMString propertyName;
Availability
- Available in Safari 4.0 and later.
- Available in iOS 2.0 and later.
Methods
initWebKitTransitionEvent
Initializes a new transition event object.
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
propertyNameproperty is always set.- canBubbleArg
Determines whether the event can bubble. Pass
trueif it can bubble; otherwise,false.- cancelableArg
Determines whether the event’s default action can be prevented. Pass
trueif 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 iOS 2.0 and later.
© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-02-24)