animation
Value: [
animation-timing-function:
Define the speed curve of the animation
ease: The animation starts at a low speed, then speeds up, before ending Slow down.
linear: constant speed
ease-in: animation starts at low speed
ease-out: animation ends at low speed
ease-in-out: animation Start and end at low speed, which is slower than ease and has a more even speed
step-start: Display frame by frame according to keyframes settings, the first frame is the first frame set by keyframes.
step-end: Display frame by frame according to keyframes settings. The first frame is the initial value of the style.
steps(
cubic-bezier(
animation-iteration-count
The number of animation iterations, the default is 1, you can set it to 2, 3, 4 times,...infinite means unlimited
animation-duration
refers to the duration of an animation cycle. The unit is seconds or milliseconds ms.
animatin-delay
refers to the animation delay execution time. Unit seconds s or milliseconds ms.
animation-direction
refers to the direction in which frames advance on the animation timeline.
normal: the default value, which means going straight forward and returning to the first frame after the last frame.
reverse: opposite to the running direction of normal
alternate: forward After playing, then rewind, rewind to the end and then play back
alternate-reverse: opposite to the running direction of alternate
animation-fill-mode
Set the state after animation ends
none: Default value. Do not set the state other than the object animation, the DOM state before animation
forwards: Set the object state to the state at the end of the animation, 100% or to, when the animation-direction is set to reverse, after the animation ends Displayed as the first frame of keyframes
backwards: Set the object state to the state when the animation starts, (test shows the DOM state before animation)
both: Set the object state to the end or start of the animation state, the state takes priority at the end
animation-play-state
paused: Set this attribute to pause the animation
running: Set this attribute to continue playing the animation
Animation running status, pause or continue playing, the attributes are: running (default) and paused. When is this useful? Use animation to achieve video playback effects. Time
Browser support (webkit kernel browsers need to be prefixed with "-webkit-"):
Simple example:
div { animation-name: diagonal-slide; animation-duration: 5s; animation-iteration-count: 10;}@keyframes diagonal-slide { from { left: 0; top: 0; } to { left: 100px; top: 100px; }}
References :
http://www.w3.org/TR/2012/WD-css3-animations-20120403/
Tips: CSS3 animation gradually realizes the little-by-little waiting prompt effect
Let’s talk about CSS3 animation to realize the loading animation