• 회원가입
  • 로그인
  • 구글아이디로 로그인

[transition] CSS - transition-timing-function 속성 - 트랜지션 속도변경곡선 (= transition-timing-function속성 = 트랜지션타이밍펑션속성)

목차
  1. transition-timing-function 예제 - 처음부터 끝까지 동일 속도 트랜지션 효과
  2. transition-timing-function 정의
  3. transition-timing-function 구문
  4. transition-timing-function 예제 - linear/ease/ease-in/ease-out/ease-in-out 차이
  5. transition-timing-function 예제 - cubic-bezier() 함수로 위 예제와 동일 효과 구현

 

transition-timing-function 예제 - 처음부터 끝까지 동일 속도 트랜지션 효과

 

<style> 

div {

  width: 200px;

  height: 100px;

  background: red;

  transition: width 2s;

  transition-timing-function: linear;

}


div:hover {

  width: 300px;

}

</style>


<div>홈짱닷컴 Homzzang.com</div>

 

결과보기

 

transition-timing-function 정의

 

트랜지션(=전환) 효과 속도 곡선 지정.

 


 

1.

이 속성 지정 시 transition-duration (= 트랜지션 완료에 걸리는 시간) 동안 지정 속도 곡선에 따라 속도 변함.

 

2.

  • 기본값: ease
  • 상속여부: X
  • 애니가능: X
  • CSS버전: CSS3
  • JS구문: object.style.transitionTimingFunction="linear"

 

3. 

IE10 이상 주요 최신 브라우저 지원. (구형 브라우저 경우 접두사 필요)

  • Chrome, Safari 브라우저 경우: -webkit-
  • Firefox 경우: -moz-
  • Opera 경우: -o-

 

4. MDN transition-timing-function 예제보기

https://developer.mozilla.org/en-US/docs/Web/CSS/transition-timing-function

 

 

transition-timing-function 구문

 

selector {transition-timing-function: linear|ease|ease-in|ease-out|ease-in-out|step-start|step-end|steps(int,start|end)|cubic-bezier(n,n,n,n)|initial|inherit;}

 


[속성값]

 

ease

기본값. 느리게 시작한 다음 빠르게 시작한 다음 천천히 종료. 

  • 동일: cubic-bezier(0.25,0.1,0.25,1) 

 

linear

처음부터 끝까지 같은 속도. 

  • 동일: cubic-bezier(0,0,1,1)

 

ease-in

시작 부분이 느림.

  • 동일: cubic-bezier(0.42,0,1,1)

 

ease-out

종료 부분이 느림.

  • 동일: cubic-bezier(0,0,0.58,1)

 

ease-in-out

시작과 끝이 느람

  • 동일: cubic-bezier(0.42,0,0.58,1)

 

step-start

동일: steps(1, start)

 

step-end

동일: steps(1, end)

 

steps(int,start|end) 

  • int - 함수의 간격수. (가능값: 0보다 큰 양의 정수)
  • start|end - 간격 내에서 값 변경 지점. (생략 시, "end" 값 사용)

 

cubic-bezier(n,n,n,n)

cubic-bezier() 함수에서 고유한 값을 정의. (가능값: 0~1 사이의 숫자)

 

initial

이 속성의 기본값으로 설정.

 

inherit

부모요소의  속성값 상속.

 

 

transition-timing-function 예제 - linear/ease/ease-in/ease-out/ease-in-out 차이

 

<style> 

div {

  width: 150px;

  height: 50px;

  background: red;

  color: white;

  text-indent:10px;

  transition: width 2s;

}


#a {transition-timing-function: linear;}

#b {transition-timing-function: ease;}

#c {transition-timing-function: ease-in;}

#d {transition-timing-function: ease-out;}

#e {transition-timing-function: ease-in-out;}


div:hover {

  width: 500px;

}

</style>


<div id="a">linear</div>

<div id="b">ease</div>

<div id="c">ease-in</div>

<div id="d">ease-out</div>

<div id="e">ease-in-out</div>

 

결과보기

 

transition-timing-function 예제 - cubic-bezier() 함수로 위 예제와 동일 효과 구현

 

<style> 

div {

  width: 150px;

  height: 50px;

  background: red;

  color: white;

  text-indent:10px;

  transition: width 2s;

}


#a {transition-timing-function: cubic-bezier(0,0,1,1);}

#b {transition-timing-function: cubic-bezier(0.25,0.1,0.25,1);}

#c {transition-timing-function: cubic-bezier(0.42,0,1,1);}

#d {transition-timing-function: cubic-bezier(0,0,0.58,1);}

#e {transition-timing-function: cubic-bezier(0.42,0,0.58,1);}


div:hover {

  width: 500px;

}

</style>


<div id="a">linear</div>

<div id="b">ease</div>

<div id="c">ease-in</div>

<div id="d">ease-out</div>

<div id="e">ease-in-out</div>


결과보기



분류 제목
transition CSS - transition-duration 속성 ★ - 트랜지션 완료에 걸리는 시간 (= transiti…
transition CSS - transition-property 속성 - 트랜지션 효과 적용할 속성명 지정 (= transit…
transition CSS - transition-timing-function 속성 - 트랜지션 속도변경곡선 (= transit…
animation CSS - @keyframes 구문 - 애니메이션 코드 사용 선언 (= 애니사용 = @keyframes속성 …
animation CSS - animation 속성 ★ - 애니메이션 단축속성 (= animation속성 = 애니메이션속성, …
animation CSS - animation-delay 속성 - 애니지연시간 (= 작동지연시간 = 작동대기시간 = 작동준비시…
animation CSS - animation-direction 속성 - 애니방향 (= 움직임방향 = 애니메이션디렉션속성, I…
animation CSS - animation-duration 속성 - 애니지속시간 (= 애니완료소요시간 = 움직임완료소요시간…
animation CSS - animation-fill-mode 속성 - 애니미작동스타일 (= 움직임 작동안할때 스타일 = 애…
animation CSS - animation-iteration-count 속성 - 애니반복횟수 (= 움직임반복횟수, IE10…
animation CSS - animation-name 속성 - 키프레임명 (= 키프레임이름 = 애니이름 = 애니명 = 애니메…
animation CSS - animation-play-state 속성 - 애니재생상태 (= 애니작동상태설정 = 움직임 재생/…
animation CSS - animation-timing-function 속성 - 애니재생중속도변화 (= 움직임 중 속도변경…
image CSS - Rounded Images (둥근/동그란 이미지 만들기 = 이미지 테두리 둥글게/동그랗게) - I…
image CSS - Thumbnail Images - (썸네일 이미지 스타일)
image CSS - enter an Image (이미지 가운데정렬/중앙정렬)
image CSS - Image Text - (이미지 위에 텍스트 배치/띄우기)
image CSS - Polaroid Images / Cards - (폴라로이드 이미지)
image CSS - Image Filter - (이미지 필터 - 흑백/흐림 효과)
image CSS - Image Hover Overlay - (이미지 마우스오버시 효과 = 이미지허버효과 = 이미지마우…
9/25
목록
찾아주셔서 감사합니다. Since 2012