CSS animasie Eiendom
Voorbeeld
Binding van 'n animasie aan 'n <div>-element deur die snelskrif-eienskap te gebruik:
div
{
animation: mymove 5s infinite;
}
Definisie en gebruik
Die animation
eiendom is 'n snelskrif eiendom vir:
- animasie-naam
- animasie-duur
- animasie-tydsberekening-funksie
- animasie-vertraging
- animasie-iterasie-telling
- animasie-rigting
- animasie-vul-modus
- animasie-speel-staat
Let wel: spesifiseer altyd die animasie-duur- eienskap, anders is die duur 0, en sal nooit gespeel word nie.
Standaard waarde: | geen 0 gemak 0 1 normaal geen loop nie |
---|---|
Geërf: | geen |
Animateerbaar: | geen. Lees oor animeerbaar |
Weergawe: | CSS3 |
JavaScript-sintaksis: | object .style.animation="mymove 5s oneindig" |
Blaaierondersteuning
Die nommers in die tabel spesifiseer die eerste blaaierweergawe wat die eiendom ten volle ondersteun.
Nommers gevolg deur -webkit-, -moz-, of -o- spesifiseer die eerste weergawe wat met 'n voorvoegsel gewerk het.
Property | |||||
---|---|---|---|---|---|
animation | 43.0 4.0 -webkit- |
10.0 | 16.0 5.0 -moz- |
9.0 4.0 -webkit- |
30.0 15.0 -webkit- 12.0 -o- |
CSS-sintaksis
animation: name duration timing-function delay iteration-count
direction fill-mode play-state;
Eiendomswaardes
Value | Description |
---|---|
animation-name | Specifies the name of the keyframe you want to bind to the selector |
animation-duration | Specifies how many seconds or milliseconds an animation takes to complete |
animation-timing-function | Specifies the speed curve of the animation |
animation-delay | Specifies a delay before the animation will start |
animation-iteration-count | Specifies how many times an animation should be played |
animation-direction | Specifies whether or not the animation should play in reverse on alternate cycles |
animation-fill-mode | Specifies what values are applied by the animation outside the time it is executing |
animation-play-state | Specifies whether the animation is running or paused |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Verwante bladsye
CSS-tutoriaal: CSS-animasies
HTML DOM verwysing: animasie eiendom