CSS 애니메이션 방향 속성
예시
애니메이션을 먼저 앞으로 재생한 다음 뒤로 재생합니다.
div {
animation-direction: alternate;
}
아래에서 더 많은 "직접 사용해 보기" 예를 살펴보세요.
정의 및 사용
속성 은 animation-direction
애니메이션을 앞으로, 뒤로 또는 대체 사이클로 재생할지 여부를 정의합니다.
기본값: | 정상 |
---|---|
상속: | 아니요 |
애니메이션 가능: | 아니요. 애니메이션 가능 에 대해 읽기 |
버전: | CSS3 |
자바스크립트 구문: | 개체 .style.animationDirection="역방향" |
브라우저 지원
표의 숫자는 속성을 완전히 지원하는 첫 번째 브라우저 버전을 지정합니다.
-webkit-, -moz- 또는 -o- 뒤에 오는 숫자는 접두사와 함께 작동한 첫 번째 버전을 지정합니다.
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 구문
animation-direction: normal|reverse|alternate|alternate-reverse|initial|inherit;
속성 값
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 |
더 많은 예
예시
애니메이션을 먼저 뒤로 재생한 다음 앞으로 재생합니다.
div {
animation-direction: alternate-reverse;
}
예시
애니메이션을 거꾸로 재생합니다.
div {
animation-direction: reverse;
}
관련 페이지
CSS 튜토리얼: CSS 애니메이션
HTML DOM 참조: animationDirection 속성