Vlastnost CSS animace-směr
Příklad
Přehrajte animaci nejprve dopředu a poté zpět:
div {
animation-direction: alternate;
}
Další příklady „Vyzkoušejte si to sami“ níže.
Definice a použití
Tato animation-direction
vlastnost určuje, zda se má animace přehrávat vpřed, vzad nebo v alternativních cyklech.
Výchozí hodnota: | normální |
---|---|
Zděděno: | Ne |
Animovatelné: | Ne. Přečtěte si o tématu Animable |
Verze: | CSS3 |
Syntaxe JavaScriptu: | objekt .style.animationDirection="reverse" |
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-direction | 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-direction: normal|reverse|alternate|alternate-reverse|initial|inherit;
Hodnoty vlastností
Value | Description | Play it |
---|---|---|
normal | Default value. The animation is played as normal (forwards) | |
reverse | The animation is played in reverse direction (backwards) | |
alternate | The animation is played forwards first, then backwards | |
alternate-reverse | The animation is played backwards first, then forwards | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Další příklady
Příklad
Přehrajte animaci nejprve zpět a poté dopředu:
div {
animation-direction: alternate-reverse;
}
Příklad
Přehrajte animaci pozpátku:
div {
animation-direction: reverse;
}
Související stránky
CSS tutoriál: CSS animace
HTML DOM reference: vlastnost animationDirection