Latest web development tutorials

propriété HTML DOM style animationFillMode

Style de Object Reference style Objets

Exemples

Changez le <div> animationFillMode attributs:

document.getElementById("myDIV").style.animationFillMode="forwards";

Essayez »

Définition et utilisation

animationFillMode attribut spécifie quand le film ne joue pas (lorsque l'animation est terminée, ou quand il y a un retard dans l'animation ne démarre pas la lecture), à ​​appliquer à l'élément de style.

Par défaut, l'animation CSS avant la lecture première image clé fini ne porte pas atteinte éléments, après l'élément d'impact de l'arrêt complet de la dernière clé. animationFillMode propriété peut remplacer ce comportement.


support du navigateur

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Seul Firefox et Opera supportent propriété animationFillMode.


grammaire

Retour propriétés animationFillMode:

object .style.animationFillMode

Définition des propriétés de animationFillMode:

object .style.animationFillMode="none|forwards|backwards|both|initial|inherit"

Valeur de la propriété

描述
none 默认值。动画在动画执行之前和之后不会应用任何样式到目标元素。
forwards 在动画结束后(由 animation-iteration-count 决定),动画将应用该属性值。
backwards 动画将应用在 animation-delay 定义期间启动动画的第一次迭代的关键帧中定义的属性值。这些都是 from 关键帧中的值(当 animationDirection 为 "normal" 或 "alternate" 时)或 to 关键帧中的值(当 animationDirection 为 "reverse" 或 "alternate-reverse" 时)。
both 动画遵循 forwards 和 backwards 的规则。也就是说,动画会在两个方向上扩展动画属性。
initial 设置该属性为它的默认值。请参阅 initial
inherit 从父元素继承该属性。请参阅 inherit

détails techniques

Par défaut: aucun
Retours: Chaîne représentant l'attribut animation-fill-mode de l'élément.
CSS version CSS3


articles connexes

CSS Manuel de référence: attribut Animation-Fill-MODE


Style de Object Reference style Objets