Re: transitions vs. animations

On Sat, Apr 3, 2010 at 1:06 AM, Håkon Wium Lie <howcome@opera.com> wrote:
> One difference between this proposal and the current specs is that it
> matters where the 'effect' property is set. For example, in the
> current specs, the following two examples have identical results (I
> believe):
>
> [example 9]
>
>  a {
>    color: blue;
>    transition: color 1s;
>  }
>
>  a:hover {
>    color: red;
>  }
>
> or:
>
> [example 10]
>
>  a {
>    color: blue;
>  }
>
>  a:hover {
>    color: red;
>    transition: color 1s;
>  }

Small comment; I haven't yet fully digested the implications of the
rest of this.

The two examples aren't equivalent.  The element has be in a
'transition-ready' state when the property that you're transitioning
"starts to change".  Your first example transitions color both ways,
but your second only transitions when the element is in :hover and the
color changes (possibly through losing :hover, since the "starts to
change" bit happens before :hover is actually lost).

Don't know how this might affect the effect proposal, or if there are
any implications of changing the model as you describe (where, I
think, having the effect set on either the starting or ending state
works?).

~TJ

Received on Saturday, 3 April 2010 17:00:40 UTC