Properti animasi CSS
Contoh
Mengikat animasi ke elemen <div>, menggunakan properti steno:
div
{
animation: mymove 5s infinite;
}
Definisi dan Penggunaan
Properti animation
adalah properti singkatan untuk:
- nama-animasi
- animasi-durasi
- animasi-waktu-fungsi
- animasi-tunda
- animasi-iterasi-hitung
- animasi-arah
- animasi-isi-mode
- animasi-play-state
Catatan: Selalu tentukan properti durasi animasi , jika tidak durasinya adalah 0, dan tidak akan pernah diputar.
Nilai bawaan: | tidak ada 0 mudah 0 1 normal tidak ada yang berjalan |
---|---|
Diwarisi: | tidak |
Animasi: | tidak. Baca tentang animasi |
Versi: kapan: | CSS3 |
Sintaks JavaScript: | objek .style.animation="mymove 5s tak terbatas" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Angka yang diikuti oleh -webkit-, -moz-, atau -o- menentukan versi pertama yang berfungsi dengan awalan.
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- |
Sintaks CSS
animation: name duration timing-function delay iteration-count
direction fill-mode play-state;
Nilai properti
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 |
Halaman Terkait
Tutorial CSS: Animasi CSS
Referensi DOM HTML: properti animasi