Animation de stylePlayState Property
Exemple
Mettre une animation en pause :
document.getElementById("myDIV").style.animationPlayState = "paused";
Définition et utilisation
La propriété animationPlayState spécifie si l'animation est en cours d'exécution ou en pause.
Remarque : Utilisez cette propriété pour suspendre une animation au milieu d'un cycle.
Prise en charge du navigateur
Les nombres dans le tableau indiquent la première version du navigateur qui prend entièrement en charge la propriété.
Les nombres suivis de Webkit, Moz ou O spécifient la première version qui a fonctionné avec un préfixe.
Property | |||||
---|---|---|---|---|---|
animationPlayState | 43.0 4.0 Webkit |
10.0 | 16.0 5.0 Moz |
9.0 4.0 Webkit |
30.0 15.0 Webkit 12.1 12.0 O |
Syntaxe
Renvoyez la propriété animationPlayState :
object.style.animationPlayState
Définissez la propriété animationPlayState :
object.style.animationPlayState = "running|paused|initial|inherit"
Valeurs de propriété
Value | Description |
---|---|
running | Default value. Specifies that the animation is running |
paused | Specifies that the animation is paused |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Détails techniques
Valeur par défaut: | fonctionnement |
---|---|
Valeur de retour : | Une chaîne, représentant la propriété animation-play-state d'un élément |
Version CSS | CSS3 |
Pages connexes
Référence CSS : propriété animation-play-state