变换与动画
变换与动画
The terms transitions and animations are often used interchangeably but are not, in my experience, one and the same:
-
A
transition
is a simple change in the style properties on an element to be transitioned in a single step. They are often handled purely through CSS. -
An
animation
is a more complex, usually multi-step and sometimes continuous change in appearance. Animations will often call on JavaScript to pick up where CSS’ lack of logic drops off. It could be to add a class and trigger the animation or to make complex state transitions that reflect onto the DOM.