AnimationEvent()
Experimental: Cette fonction est expérimentale
Puisque cette fonction est toujours en développement dans certains navigateurs, veuillez consulter le tableau de compatibilité pour les préfixes à utiliser selon les navigateurs.
Il convient de noter qu'une fonctionnalité expérimentale peut voir sa syntaxe ou son comportement modifié dans le futur en fonction des évolutions de la spécification.
Le constructeur AnimationEvent()
retourne un nouvel AnimationEvent
, représentant un évènement en relation avec une animation.
Syntaxe
animationEvent = new AnimationEvent(type, {animationName: aPropertyName, elapsedTime : aFloat, pseudoElement: aPseudoElementName});
Paramètres
Le constructeur AnimationEvent()
hérite également des arguments du constructeur Event()
.
type
-
Un
DOMString
représentant le nom du type deAnimationEvent
. Il est sensible à la casse (majuscule-minuscule) et peut être:'animationstart'
,'animationend'
, or'animationiteration'
. animationName
Facultatif-
Un
DOMString
contenant la valeur de la propriété associée avec la transition.animation-name
. Prend par défaut""
. elapsedTime
Facultatif-
Un
float
donne le montant de temps d'une application qui a fonctionné, en secondes, quand l'évènement est déclenché, excluant le temps de pause des animations. Pour un évènementanimationstart
,elapsedTime
est de0.0
jusqu'à ce qu'il y ait une valeur négative pour une valeuranimation-delay
, dans le cas où l'évènement est déclenché parelapsedTime
contenant(-1 * délai)
. Sa valeur par défaut vaut0.0
. pseudoElement
Facultatif-
Is a
DOMString
, starting with"::"
, containing the name of the pseudo-element the animation runs on. If the animation doesn't run on a pseudo-element but on the element itself, specify an empty string:""
. It defaults to""
.
Return value
A new AnimationEvent
, initialized per any provided options.
Specifications
Specification | Status | Comment |
---|---|---|
CSS Animations Level 1 La définition de 'AnimationEvent()' dans cette spécification. |
Version de travail | Initial definition. |
Browser compatibility
BCD tables only load in the browser
See also
- Using CSS animations
- Animation-related CSS properties and at-rules:
animation
,animation-delay
,animation-direction
,animation-duration
,animation-fill-mode
,animation-iteration-count
,animation-name
,animation-play-state
,animation-timing-function
,@keyframes
- The
AnimationEvent
interface it belongs to.