CSS3 Transitions support in Opera Presto 2.4

Opera offers partial support for the CSS3 Transitions module. CSS3 Transitions enable implicit transitions, which allow CSS properties to change smoothly from one value to another over a given duration. Normally when the value of a CSS property changes, the rendered result is instantly updated, with the affected elements immediately changing from the old property value to the new property value. CSS3 Transitions provide a way to specify transitions using new CSS properties. These properties are used to animate smoothly from the old state to the new state over time.

On this page...
Transition properties support
Transition events support
Animation of property types support

Transition properties support

Opera supports the following CSS3 Transition properties prefixed with "-o-".

-o-transition-property property

This property specifies the name of the CSS property to which the transition is applied. A value of "none" means that no property will transition. A value of "all" means that every property that is able to undergo a transition will do so. Otherwise, a list of properties to be transitioned is given.

-o-transition-property support data
Property name-o-transition-property
Value(s)none | all | [ <IDENT> ] | [ "," <IDENT> ]*
Initialall
Applies toblock-level and inline-level elements
Inheritedno
Percentagesn/a
Mediavisual
Computed valuesame as specified value
SupportYes

-o-transition-duration property

This property defines the length of time that a transition takes. It specifies how long the transition from the old value to the new value should take. By default the value is ‘0’, meaning that the transition is immediate (i.e. there will be no animation). A negative value for transition-duration is treated as ‘0’.

-o-transition-duration support data
Property name-o-transition-duration
Value(s)<time> [, <time>]*
Initial0
Applies toblock-level and inline-level elements
Inheritedno
Percentagesn/a
Mediavisual
Computed valuesame as specified value
SupportYes

-o-transition-timing-function property

This property describes how the intermediate values used during a transition will be calculated. It allows for a transition to change speed over its duration. These effects are commonly called easing functions. In either case, a mathematical function that provides a smooth curve is used.

The timing function is specified using a cubic bezier curve, which is defined by four control points, P0 through P3. P0 and P3 are always set to (0,0) and (1,1). The -o-transition-timing-function property is used to specify the values for points P1 and P2. These can be set to preset values using the keywords listed below, or can be set to specific values using the "cubic-bezier" function. In the "cubic-bezier" function, P1 and P2 are each specified by both an X and Y value. The timing function takes as its input the current elapsed percentage of the transition duration and outputs a percentage that determines how close the transition is to its goal state.

Timing function value definitions:

ease
The ease function is equivalent to cubic-bezier(0.25, 0.1, 0.25, 1.0).
linear
The linear function is equivalent to cubic-bezier(0.0, 0.0, 1.0, 1.0).
ease-in
The ease-in function is equivalent to cubic-bezier(0.42, 0, 1.0, 1.0).
ease-out
The ease-out function is equivalent to cubic-bezier(0, 0, 0.58, 1.0).
ease-in-out
The ease-in-out function is equivalent to cubic-bezier(0.42, 0, 0.58, 1.0).
cubic-bezier
Specifies a cubic-bezier curve.
  • The four values specify points P1 and P2 of the curve as (x1, y1, x2, y2).
  • All values must be in the range [0, 1] or the definition is invalid.
-o-transition-timing-function support data
Property name-o-transition-timing-function
Value(s)ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier(<number>, <number>, <number>, <number>) [, ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier(<number>, <number>, <number>, <number>)]*
Initialease
Applies toblock-level and inline-level elements
Inheritedno
Percentagesn/a
Mediavisual
Computed valuesame as specified value
SupportYes

-o-transition-delay property

This property defines when the transition will start. It allows a transition to begin execution some some period of time from when it is applied. A -o-transition-delay value of "0" means the transition will execute as soon as the property is changed. Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset.

If the value for -o-transition-delay is a negative time offset then the transition will execute the moment the property is changed, but will appear to have begun execution at the specified offset. That is, the transition will appear to begin part-way through its play cycle. In the case where a transition has implied starting values and a negative -o-transition-delay, the starting values are taken from the moment the property is changed.

-o-transition-delay support data
Property name-o-transition-delay
Value(s)<time> [, <time>]*
Initial0
Applies toblock-level and inline-level elements
Inheritedno
Percentagesn/a
Mediavisual
Computed valuesame as specified value
SupportYes

-o-transition shorthand property

This shorthand property combines the four properties described above into a single property.

-o-transition shorthand support data
Property name-o-transition (shorthand)
Value(s)[<-o-transition-property> || <-o-transition-duration> || <-o-transition-timing-function> || <-o-transition-delay> [, [<-o-transition-property> || <-o-transition-duration> || <-o-transition-timing-function> || <-o-transition-delay>]]*
Initialsee individual properties
Applies toblock-level and inline-level elements
Inheritedno
Percentagesn/a
Mediavisual
Computed valuesame as specified value
SupportYes

Transition events support

The completion of a CSS3 Transition generates a corresponding DOM Event. An event is fired for each property that undergoes a transition. This allows a content developer to perform actions that synchronize with the completion of a transition. Each event provides the name of the property the transition is associated with as well as the duration of the transition.

Interface OTransitionEvent

This interface provides specific contextual information associated with transitions.

IDL Definition
interface OTransitionEvent : Event {
    readonly attribute DOMString          propertyName;
    readonly attribute float              elapsedTime;
    void               initTransitionEvent(in DOMString typeArg,
                                          in boolean canBubbleArg,
                                          in boolean cancelableArg,
                                          in DOMString propertyNameArg,
                                          in float elapsedTimeArg);
  };
Attributes

Attribute Description Support
propertyName of type DOMString, readonly The name of the CSS property associated with
the transition.
Yes
elapsedTime of type float, readonly The amount of time the transition has been
running, in seconds, when this event fired.
Note that this value is not affected by the
value of transition-delay.
Yes
Methods
initTransitionEvent

This method is used to initialize the value of a OTransitionEvent created through the DocumentEvent interface. This method may only be called before the OTransitionEvent has been dispatched via the dispatchEvent method, though it may be called multiple times during that phase if necessary. If called multiple times, the final invocation takes precedence.

Parameters

Parameter Description Support
typeArg of type DOMString Specifies the event type. Yes
canBubbleArg of type boolean Specifies whether or not the event can bubble. Yes
cancelableArg of type boolean Specifies whether or not the event's default
action can be prevented.
Yes
propertyNameArg of type DOMString Specifies the name of the property associated
with the Event.
Yes
elapsedTimeArg of type float Specifies the amount of time, in seconds, the
transition has been running at the time of
initialization.
Yes
No Return Value | No Exceptions

There is one type of transition event available.

Event Description Support
oTransitionEnd The oTransitionEnd event occurs at the completion of the transition.
  1. Bubbles: Yes
  2. Cancelable: Yes
  3. Context Info: propertyName
Yes

Animation of property types support

The following list defines how each property type undergoes transition or animation.

color
Interpolated via red, green, blue and alpha components (treating each as a number, see below).
length
Interpolated as real numbers.
percentage
Interpolated as real numbers.
integer
Interpolated via discrete steps (whole numbers); the interpolation happens in real number space and is converted to an integer using floor().
number
Interpolated as real (floating point) numbers.
transform list
See the CSS Transforms specification.
rectangle
Interpolated via the x, y, width and height components (treating each as a number).
visibility
Interpolated via a discrete step; the interpolation happens in real number space between 0 and 1, where 1 is "visible" and all other values are "hidden".
shadow
Interpolated via the color, x, y and blur components (treating them as color and numbers where appropriate).
gradient
Interpolated via the positions and colors of each stop; they must have the same type (radial or linear) and same number of stops in order to be animated.
paint server (SVG)
Note: Opera does not yet support paint server (SVG)
Interpolation is only available between:
  • gradient to gradient
  • color to color
They then work as described above.
space-separated list of above
Each item in the list is interpolated using the rules above.

Animatable properties

Opera offers partial support for animation properties as identified in the following table.

CSS animation properties support
Property Name Type Support
background-color color Yes
background-image only gradients No
background-position percentage, length No
border-bottom-color color No
border-bottom-width length Yes
border-color color No
border-left-color color No
border-left-width length Yes
border-right-color color No
border-right-width length Yes
border-spacing length Yes
border-top-color color No
border-top-width length Yes
border-width length Yes
bottom length, percentage Yes
color color Yes
crop rectangle No
font-size length, percentage Yes
font-weight number Yes
grid-* various No
height length, percentage Yes
left length, percentage Yes
letter-spacing length Yes
line-height number, length, percentage Yes
margin-bottom length Yes
margin-left length Yes
margin-right length Yes
margin-top length Yes
max-height length, percentage Yes
max-width length, percentage Yes
min-height length, percentage Yes
min-width length, percentage Yes
opacity number Yes
outline-color color Yes
outline-offset integer Yes
outline-width length Yes
padding-bottom length Yes
padding-left length Yes
padding-right length Yes
padding-top length Yes
right length, percentage Yes
text-indent length, percentage Yes
text-shadow shadow No
top length, percentage Yes
vertical-align keywords, length, percentage Yes
visibility visibility Yes
width length, percentage Yes
word-spacing length, percentage Yes
z-index integer Yes
zoom number No

SVG properties

For your guide, Opera currently does not support SVG properties in CSS3 Transitions.

SVG properties
Property Name Type Support
stop-color color No
stop-opacity float No
fill paint server No
fill-opacity float No
stroke paint server No
stroke-dasharray list of numbers No
stroke-dashoffset number No
stroke-miterlimit number No
stroke-opacity float No
stroke-width float No
viewport-fill color No
viewport-fill-opacity color No

Documentation

Opera Help

Need help? Hit F1 anytime while using Opera to access our online help files, or go here.