Vlastnost CSS animace
Příklad
Navázání animace na prvek <div> pomocí vlastnosti zkratky:
div
{
animation: mymove 5s infinite;
}
Definice a použití
Vlastnost animation
je zkrácená vlastnost pro:
- název-animace
- délka animace
- funkce animace-časování
- animace-zpoždění
- animace-iterace-počet
- animace-režie
- režim animace
- animace-přehrát-stav
Poznámka: Vždy zadejte vlastnost animation-duration , jinak je trvání 0 a nikdy se nepřehraje.
Výchozí hodnota: | žádný 0 snadný 0 1 normální žádný běží |
---|---|
Zděděno: | Ne |
Animovatelné: | Ne. Přečtěte si o tématu Animable |
Verze: | CSS3 |
Syntaxe JavaScriptu: | objekt .style.animation="mymove 5s infinite" |
Podpora prohlížeče
Čísla v tabulce určují první verzi prohlížeče, která plně podporuje vlastnost.
Čísla následovaná -webkit-, -moz- nebo -o- určují první verzi, která pracovala s předponou.
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- |
Syntaxe CSS
animation: name duration timing-function delay iteration-count
direction fill-mode play-state;
Hodnoty vlastností
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 |
Související stránky
CSS tutoriál: CSS animace
HTML DOM reference: vlastnost animace