Defines whether an animation is running or paused.
Overview tablerunning
animation-play-state: paused
animation-play-state: running
The CSS uses the animation property and the @keyframes property as well as the animation-play-state property and more.
The example show how to create a counter like function. By using the “:checked” selector for radio buttons we toggle the animation states for the counter
#stopwatch_handles {
margin-top: 0px;
}
#stopwatch_handles label {
cursor: pointer;
padding: 5px 5px;
font-family: Verdana, sans-serif;
font-size: 12px;
}
input[name="handles"] {display: none;}
#stopbtn:checked~.stopwatch .numbers {
animation-play-state: paused
}
#startbtn:checked~.stopwatch .numbers {
animation-play-state: running
}
.moveten {
animation: moveten 1s steps(10, end) infinite;
animation-play-state: paused;
}
.movesix {
animation: movesix 1s steps(6, end) infinite;
animation-play-state: paused;
}
.second {
animation-duration: 10s;
}
.tensecond {
animation-duration: 60s;
}
@keyframes moveten {
0% {top: 0;}
100% {top: -300px;}
}
@keyframes movesix {
0% {top: 0;}
100% {top: -180px;}
}
A mobile-like interface featuring a keyframe-animated pulsing icon. When the application enters an interruption mode, the icon is paused and the page presents another panel to indicate that the animation is inactive.
div.selected {
animation: pulse 0.5s infinite alternate running;
}
body.interrupt div.selected {
animation-play-state: paused;
}
@keyframes pulse {
from {
transform : scale(1) translateX(0);
opacity : 1;
}
to {
transform : scale(0.75) translateX(0);
opacity : 0.25;
}
}
Usage
Can also be a comma-separated list of play states, e.g., running, paused, running, where each play state is applied to the corresponding ordinal position value of the animation-name property.
Related specifications
Microsoft Developer Network: Windows Internet Explorer API reference Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4