8 properties of CSS3 animation (Animation) that you must master

零下一度
Release: 2017-05-18 14:36:21
Original
2192 people have browsed it

animation composite properties. Retrieves or sets the animation effects applied to the object.

If there are multiple attribute values ​​separated by ",", it applies to all elements, including pseudo objects :after and :before

1.animation-name Retrieve or set the animation name applied to the object

Must be used in conjunction with the rule @keyframes, eg:@keyframes animations animation-name:animations;

2.animation-duration Retrieve or set the duration of the object animation

animation-duration:3s; Animation completed The time used is 3s

3.animation-timing-function Retrieve or set the transition type of object animation

linear: linear transition. Equivalent to Bezier curve (0.0, 0.0, 1.0, 1.0)

ease: smooth transition. Equivalent to Bezier curve (0.25, 0.1, 0.25, 1.0)

ease-in: from slow to fast. Equivalent to Bezier curve (0.42, 0, 1.0, 1.0)

ease-out: from fast to slow. Equivalent to Bezier curve (0, 0, 0.58, 1.0)

ease-in-out: from slow to fast and then to slow. Equivalent to Bezier curve (0.42, 0, 0.58, 1.0)

step-start: Equivalent to steps(1, start)

step-end: Equivalent to steps(1, end )

steps(<integer>[, [ start | end ] ]?): A step function that accepts two parameters. The first parameter must be a positive integer specifying the number of steps of the function. The value of the second parameter can be start or end, specifying the time point when the value of each step changes. The second parameter is optional and the default value is end.

cubic-bezier(, , , ): A specific Bezier curve type, the 4 values ​​​​must be in the [0, 1] interval Inside

4.animation-delay Retrieve or set the object animation delay time

animation-delay:0.5s; The delay time before the animation starts is 0.5s

5.animation-iteration-count Retrieve or set the cyclenumber of times

animation -iteration-count: infinite | number;

infinite: infinite loop

number: number of loops

6.animation-direction Retrieve or set the object animation Whether to move in the reverse direction during the loop

normal: normal direction

reverse: run in the reverse direction

alternate: the animation runs normally and then in the reverse direction, and continues to alternate Run

alternate-reverse: The animation first runs in the reverse direction and then runs in the forward direction, and continues to run alternately

7.animation-play-state Retrieve or set the state of the object animation

animation-play-state:running | paused;

running:motion

paused: pause

animation-play-state:paused; When the mouse The animation stops when it passes, and the animation continues when the mouse moves away

8.animation-fill-mode Retrieve or set the state of the object outside the animation time

none: default value , do not set the state of the object outside of the animation

forwards: Set the object state to the state at the end of the animation

backwards: Set the object state to the state at the beginning of the animation

both :Set the object state to the state when the animation starts or ends

[Related recommendations]

1. Detailed introduction to the animation-direction attribute in CSS3

2. Share an example of monitoring the css3 animation (animation) end event

3. Use the animation attribute to implement delayed execution between loops tutorial

4. Detailed explanation of the two pause methods (transition, animation) in css3

The above is the detailed content of 8 properties of CSS3 animation (Animation) that you must master. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template