CSS animatie-richting Eigenschap
Voorbeeld
Speel de animatie eerst vooruit en dan achteruit af:
div {
animation-direction: alternate;
}
Meer "Probeer het zelf" voorbeelden hieronder.
Definitie en gebruik
De animation-direction
eigenschap bepaalt of een animatie vooruit, achteruit of afwisselend moet worden afgespeeld.
Standaardwaarde: | normaal |
---|---|
geërfd: | Nee |
Animeerbaar: | Nee. Lees over animeren |
Versie: | CSS3 |
JavaScript-syntaxis: | object .style.animationDirection="reverse" |
Browserondersteuning
De getallen in de tabel geven de eerste browserversie aan die de eigenschap volledig ondersteunt.
Getallen gevolgd door -webkit-, -moz- of -o- specificeren de eerste versie die met een prefix werkte.
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- |
CSS-syntaxis
animation-direction: normal|reverse|alternate|alternate-reverse|initial|inherit;
Eigendomswaarden
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 |
Meer voorbeelden
Voorbeeld
Speel de animatie eerst achteruit, dan vooruit:
div {
animation-direction: alternate-reverse;
}
Voorbeeld
Speel de animatie achterstevoren af:
div {
animation-direction: reverse;
}
Gerelateerde pagina's
CSS-zelfstudie: CSS-animaties
HTML DOM-referentie: animatieDirection-eigenschap