CSS animation Свойство
Пример
Привязка анимации к элементу <div> с использованием сокращенного свойства:
div
{
animation: mymove 5s infinite;
}
Определение и использование
Свойство animation
является сокращенным свойством для восьми свойств анимации:
- animation-name
- animation-duration
- animation-timing-function
- animation-delay
- animation-iteration-count
- animation-direction
- animation-fill-mode
- animation-play-state
Примечание: Всегда указывайте свойство Длительность анимации, в противном случае длительность равна 0 и никогда не будет воспроизводиться.
Значение по умолчанию: | none 0 ease 0 1 normal none running |
---|---|
Inherited: | no |
Animatable: | no. Читайте о animatable |
Version: | CSS3 |
Синтаксис JavaScript: | object.style.animation="mymove 5s infinite" |
Поддержка браузера
Номера в таблице указывают первую версию браузера, которая полностью поддерживает свойство.
Номера следуют -webkit-, -moz-, or -o- Укажет первую версию, которая работала с префиксом.
Свойство | |||||
---|---|---|---|---|---|
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- |
Синтаксис CSS
animation: name duration timing-function delay iteration-count
direction fill-mode play-state;
Значения свойств
Значение | Описание | |
---|---|---|
animation-name | Задает имя ключевого кадра, который требуется привязать к селектору | |
animation-duration | Указывает, сколько секунд или миллисекунд требуется анимации для завершения | |
animation-timing-function | Задает кривую скорости анимации | |
animation-delay | Указывает задержку перед запуском анимации | |
animation-iteration-count | Указывает, сколько раз должна воспроизводиться анимация | |
animation-direction | Указывает, должна ли анимация воспроизводиться в обратном порядке на альтернативных циклах | |
animation-fill-mode | Указывает, какие значения применяются анимацией вне времени ее выполнения | |
animation-play-state | Указывает, запущена ли анимация или приостановлена | |
initial | Присваивает этому свойству значение по умолчанию. (Читайте о initial) | |
inherit | Наследует это свойство из родительского элемента. (Читайте о inherit) |
Похожие страницы
CSS Справочник: CSS Анимация
HTML DOM Справочник: animation Свойства