Propriété animationPlayState du style
Exemples
Mettre une animation en pause :
document.getElementById("myDIV").style.animationPlayState="paused";
Essayez-le vous-même »
Définition et utilisation
La propriété animationPlayState spécifie si une animation est en cours d'exécution ou en pause.
Remarque :Utilisez cette propriété pour mettre en pause une animation en cours de lecture.
Prise en charge des navigateurs
![]()
![]()
![]()
![]()
![]()
Internet Explorer 10, Firefox et Opera prennent en charge la propriété animationPlayState.
Safari et Chrome prennent en charge une autre propriété alternative, la propriété WebkitAnimationPlayState.
Remarque :Internet Explorer 9 et les versions antérieures ne prennent pas en charge la propriété animationPlayState.
Syntaxe
Retourner la propriété animationPlayState :
object.style.animationPlayState
Définir la propriété animationPlayState :
object.style.animationPlayState="running|paused|initial|inherit"
Valeurs de propriété
| Valeur | Description |
|---|---|
| running | Valeur par défaut. Spécifie que l'animation est en cours d'exécution. |
| paused | Spécifie que l'animation est en pause. |
| initial | Définit cette propriété sur sa valeur par défaut. Voirinitial。 |
| inherit | Hérite de cette propriété de son élément parent. Voirinherit。 |
Détails techniques
| Valeur par défaut : | running |
|---|---|
| Valeur de retour : | Une chaîne représentant la propriété animation-play-state d'un élément. |
| Version CSS | CSS3 |
Articles connexes
Manuel de référence CSS :propriété animation-play-state
Autres extensions
Objet Style