Animacja styluTimingFunction Property
Przykład
Zmiana właściwości animationTimingFunction elementu <div>:
document.getElementById("myDIV").style.animationTimingFunction = "linear";
Definicja i użycie
AnimationTimingFunction określa krzywą prędkości animacji.
Krzywa szybkości określa CZAS, w którym animacja zmienia jeden zestaw stylów CSS na inny.
Krzywa prędkości służy do płynnego wprowadzania zmian.
Obsługa przeglądarki
Liczby w tabeli określają pierwszą wersję przeglądarki, która w pełni obsługuje tę właściwość.
Liczby, po których następuje Moz, określają pierwszą wersję, która działała z przedrostkiem.
Property | |||||
---|---|---|---|---|---|
animationTimingFunction | 43.0 | 79.0 | 16.0 5.0 Moz |
9.0 | 30.0 |
Składnia
Zwróć właściwość animationTimingFunction:
object.style.animationTimingFunction
Ustaw właściwość animationTimingFunction:
object.style.animationTimingFunction = "linear|ease|ease-in|ease-out|cubic-bezier(n, n, n, n)|initial|inherit"
Wartości nieruchomości
Value | Description |
---|---|
linear | The animation has the same speed from start to end |
ease | Default value. The animation has a slow start, then fast, before it ends slowly |
ease-in | The animation has a slow start |
ease-out | The animation has a slow end |
ease-in-out | The animation has both a slow start and a slow end |
cubic-bezier(n, n, n, n) | Define your own values in the cubic-bezier function Possible values are numeric values from 0 to 1 |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Szczegóły techniczne
Domyślna wartość: | łatwość |
---|---|
Wartość zwrotu: | String, reprezentujący właściwość animacji-timing-function elementu |
Wersja CSS | CSS3 |
Powiązane strony
Odniesienie CSS: animacja-timing-function property