Styl animasieFillMode Eiendom
Voorbeeld
Verander die animationFillMode-eienskap van 'n <div>-element:
document.getElementById("myDIV").style.animationFillMode = "forwards";
Definisie en gebruik
Die animationFillMode-eienskap spesifiseer watter style vir die element sal geld wanneer die animasie nie speel nie (wanneer dit klaar is, of wanneer dit 'n "vertraging") het.
By verstek sal CSS-animasies nie die element wat jy animeer beïnvloed nie totdat die eerste sleutelraam "gespeel" word nie, en hou dan op om dit te beïnvloed sodra die laaste sleutelraam voltooi is. Die animationFillMode-eienskap kan hierdie gedrag ignoreer.
Blaaierondersteuning
Die nommers in die tabel spesifiseer die eerste blaaierweergawe wat die eiendom ten volle ondersteun.
Nommers gevolg deur Moz spesifiseer die eerste weergawe wat met 'n voorvoegsel gewerk het.
Property | |||||
---|---|---|---|---|---|
animationFillMode | 43.0 | 79.0 | 16.0 5.0 Moz |
9.0 | 30.0 |
Sintaksis
Gee die animationFillMode-eienskap terug:
object.style.animationFillMode
Stel die animationFillMode-eienskap:
object.style.animationFillMode = "none|forwards|backwards|both|initial|inherit"
Eiendomswaardes
Value | Description |
---|---|
none | Default value. The animation will not apply any styles to the target before or after it is executing |
forwards | After the animation ends (determined by animation-iteration-count), the animation will apply the property values for the time the animation ended |
backwards | The animation will apply the property values defined in the keyframe that will start the first iteration of the animation, during the period defined by animation-delay. These are either the values of the from keyframe (when animation-direction is "normal" or "alternate") or those of the to keyframe (when animationDirection is "reverse" or "alternate-reverse") |
both | The animation will follow the rules for both forwards and backwards. That is, it will extend the animation properties in both directions |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Tegniese besonderhede
Standaard waarde: | geen |
---|---|
Terugkeerwaarde: | 'n String, wat die animasie-vul-modus-eienskap van 'n element verteenwoordig |
CSS weergawe | CSS3 |
Verwante bladsye
CSS verwysing: animasie-vul-modus eiendom