Opera Presto 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.
Opera Presto supports the following CSS3 Transition properties prefixed with "-o-".
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.
Property name | -o-transition-property |
---|---|
Value(s) | none | all | [ <IDENT> ] | [ "," <IDENT> ]* |
Initial | all |
Applies to | block-level and inline-level elements |
Inherited | no |
Percentages | n/a |
Media | visual |
Computed value | same as specified value |
Support | Partial: see Animation of property types support |
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’.
Property name | -o-transition-duration |
---|---|
Value(s) | <time> [, <time>]* |
Initial | 0 |
Applies to | block-level and inline-level elements |
Inherited | no |
Percentages | n/a |
Media | visual |
Computed value | same as specified value |
Support | Partial: see Animation of property types support |
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:
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>)]* |
Initial | ease |
Applies to | block-level and inline-level elements |
Inherited | no |
Percentages | n/a |
Media | visual |
Computed value | same as specified value |
Support | Partial: see Animation of property types support |
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.
Property name | -o-transition-delay |
---|---|
Value(s) | <time> [, <time>]* |
Initial | 0 |
Applies to | block-level and inline-level elements |
Inherited | no |
Percentages | n/a |
Media | visual |
Computed value | same as specified value |
Support | Partial: see Animation of property types support |
This shorthand property combines the four properties described above into a single property.
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>]]* |
Initial | see individual properties |
Applies to | block-level and inline-level elements |
Inherited | no |
Percentages | n/a |
Media | visual |
Computed value | same as specified value |
Support | Partial: see Animation of property types 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.
This interface provides specific contextual information associated with transitions.
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); };
Attribute | Description | Support |
---|---|---|
propertyName of type DOMString, readonly |
The name of the CSS property associated with the transition. |
Partial: see Animation of property types support |
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. |
Partial: see Animation of property types support |
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.
|
Yes |
The following list defines how each property type undergoes transition or animation.
Opera Presto offers partial support for animation properties as identified in the following table.
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 |
For your guide, Opera Presto currently does not support SVG properties in CSS3 Transitions.
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 |
Need help? Hit F1 anytime while using Opera to access our online help files, or go here.