W3C home > Mailing lists > Public > www-style@w3.org > March 2010

Re: transitions vs. animations

From: Simon Fraser <smfr@me.com>
Date: Fri, 19 Mar 2010 10:12:45 -0700
Cc: www-style@w3.org
Message-id: <C518BA25-B9F7-49D4-B26C-315064B325D9@me.com>
To: Håkon Wium Lie <howcome@opera.com>
[re-send including the list].

On Mar 19, 2010, at 3:23 AM, Håkon Wium Lie wrote:

> The transition and the animation effects described in this example are
> very similar. It seems possible to consider transitions as a subset of
> animations and that names therefore can be reused. For example, we
> could use 'animation-duration' instead of 'transition-duration' in the
> example above.
> 
> No?

The way you've written this example makes them look similar, but there is a fundamental conceptual difference.

Transitions provide interpolation between existing CSS property value changes. In other words, if the 'left' property changes from 10px to 100px, without a transition it will change instantaneously. With a transition, it will change over time. This allows transitions to have a nice fallback behavior in older browsers which don't support them; users won't see the nice smooth changes, but the changes still happen.

The key concept with animations is that you apply style in order to put an element into an animating state. Just as you use CSS to set the highlight state of a button, you can use CSS to put an element into a "bouncing" state. That state may be temporary (finite number of iterations) or permanent (infinite). The properties in the animation keyframes are applied after all other properties, and override them, so animations don't provide nice fallback behavior (older browsers simply won't show the animations).

I think these concepts are different enough to warrant keeping them separate.

Simon
Received on Friday, 19 March 2010 17:13:31 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:25 GMT