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

[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>


결과보기



분류 제목
gradient CSS - repeating-radial-gradient () 함수 - 방사형 그레이디언트 반복 (= 그라디…
selector CSS - :read-write 가상선택자 - 읽고쓰기가능요소 (= readonly속성없는요소, IE13)
border CSS - border-image-outset 속성 - 테두리 경계 넘는 이미지 양. (= 보더이미지아웃셋속…
selector CSS - :optional 가상선택자 - 선택입력요소 (= required 속성없는 요소, IE10)
responsive CSS - RES Intro - (반응형 웹디자인 소개)
css CSS - 구글 로그인 포커스 애니 효과 (Google Logn Foucs Animation Effect) …
pagination CSS - 페이징 - 둥근테두리 효과 (Rounded bordered pagination)
image CSS - Thumbnail Images - (썸네일 이미지 스타일)
selector CSS - .class1 .class2 클래스선택자 ★★ - class1자손 중 class2 갖는 모든 요소
pagination CSS - 페이징 - 트랜지션 효과 (Hoverable Transition Effect)
gradient CSS - repeating-linear-gradient () 함수 - 반복 선형 그레이디언트 ※ 패턴 배경
border CSS - border-image-source 속성 - 테두리 이미지 주소 (= border-image-so…
image CSS - object-fit 속성 - 컨테이너에 맞게 '이미지/비디오' 크기 조정 방법 지정 (= obje…
pagination CSS - 페이징 - 가운데 정렬 (Centered Pagination)
border CSS - border-right 속성 - 테두리우측일괄 (= 테두리오른쪽일괄 = border-right속성…
animation CSS - animation-timing-function 속성 - 애니재생중속도변화 (= 움직임 중 속도변경…
border CSS - border-left-style 속성 - 테두리좌측모양 (= 테두리왼쪽모양 = border-lef…
border CSS - border-right-color 속성 - 테두리우측색상 (= 테두리오른쪽색상 = 테두리우측색깔…
border CSS - border-image-width 속성 - 테두리 이미지 너비 (= border-image-wid…
border CSS - border-top-style 속성 - 테두리상단모양 (= 테두리상단스타일 = border-top…
14/27
목록
찾아주셔서 감사합니다. Since 2012