Animation Pausing and Playback in CSS


Control animations with animation-play-state and toggle between running and paused states.

Source Code

.paused-animation {
    animation: spin 4s linear infinite;
    animation-play-state: paused; /* Toggle to 'running' to play */
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments