스타일 전환 속성
예시
모양을 점차적으로 변경하려면 div 요소 위로 마우스를 가져갑니다.
document.getElementById("myDIV").style.transition = "all 2s";
정의 및 사용
transition 속성은 다음 네 가지 transition 속성에 대한 약식 속성입니다.
transitionProperty, transitionDuration, transitionTimingFunction 및 transitionDelay.
참고: 항상 transitionDuration 속성을 지정하십시오. 그렇지 않으면 지속 시간이 0이고 전환이 적용되지 않습니다.
브라우저 지원
표의 숫자는 속성을 완전히 지원하는 첫 번째 브라우저 버전을 지정합니다.
Property | |||||
---|---|---|---|---|---|
transition | 26.0 | 10.0 | 16.0 | 6.1 3.1 WebkitTransition |
12.1 |
통사론
전환 속성을 반환합니다.
object.style.transition
전환 속성을 설정합니다.
object.style.transition = "property duration timing-function delay|initial|inherit"
속성 값
Value | Description |
---|---|
transitionProperty | Specifies the name of the CSS property the transition effect is for |
transitionDuration | Specifies how many seconds or milliseconds the transition effect takes to complete |
transitionTimingFunction | Specifies the speed curve of the transition effect |
transitionDelay | Defines when the transition effect will start |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
기술적 세부 사항
기본값: | 모두 0 용이함 0 |
---|---|
반환 값: | 요소의 전환 속성을 나타내는 String |
CSS 버전 | CSS3 |
관련 페이지
CSS 참조: 전환 속성
❮ 스타일 개체