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

[DOM_Style] JS - animationTimingFunction 속성 - 애니속도변화 (= 애니속도변경 = 애니속도곡선 = 애니속도조절 = 애니속도설정 = 애니타이밍펑션 속성 = 애니메이션타이밍펑션 속성, IE지원X)

목차
  1. animationTimingFunction 예제 - 애니 속도 변화
  2. animationTimingFunction 정의
  3. animationTimingFunction 구문

 

animationTimingFunction 예제 - 애니 속도 변화 

 

<style> 

#hz {

  width: 100px;

  height: 100px;

  background: red;

  position: relative;

  animation: hzmove 2s infinite;

  -webkit-animation: hzmove 2s infinite;  /* Chrome, Safari, Opera */

}


/* Chrome, Safari, Opera */

@-webkit-keyframes hzmove {

  from {left: 0px;}

  to {left: 200px;}

}


@keyframes hzmove {

  from {left: 0px;}

  to {left: 200px;}

}

</style>


<button onclick="homzzang()">클릭</button>


<script>

function homzzang() {

  document.getElementById("hz").style.WebkitAnimationTimingFunction = "linear";  // Chrome, Safari, Opera

  document.getElementById("hz").style.animationTimingFunction = "linear";

}

</script>


<div id="hz"></div>

 

결과보기

 

animationTimingFunction 정의

 

애니메이션의 속도 곡선 지정.

 


 

1.

속도 곡선

  • 정의: 애니메이션이 한 CSS 스타일 세트에서 다른 CSS 스타일 세트로 변경하는 데 사용하는 시간.
  • 용도: 속도 곡선은 부드럽게 변경하는 데 사용. 

 

2.

IE 제외한 주요 최신브라우저 모두 지원.

 

 

3.

  • 기본값: ease
  • 반환값: 요소의 animation-timing-function 속성의 속성값 문자열
  • CSS 버전: CSS3

 

 

animationTimingFunction 구문

 

애니 속도 반환

object.style.animationTimingFunction

  

애니 속도 설정

object.style.animationTimingFunction = "linear|ease|ease-in|ease-out|cubic-bezier(n, n, n, n)|initial|inherit" 

 


[속성값]

 

inear

애니메이션의 시작부터 끝까지 속도 동일.

 

ease

애니메이션이 느리게 시작된 다음 느리게 끝나기 전에 빨라짐. (기본값)

 

ease-in

애니메이션 시작 부분이 느림.

 

ease-out

애니메이션 끝 부분이 느림.

 

ease-in-out

애니메이션 시작과 끝 둘 다 느림.

 

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

큐빅 베지어 함수에서 자신의 값을 정의. (0 ≤ n ≤ 1)

 

initial

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

 

inherit

부모 요소의 속성값 상속 

 



분류 제목
HTML_Objects JS - <iframe> 객체 ★ - 타웹페이지삽입 (= iframe태그 = 아이프레임태그)
HTML_Objects JS - <img> 객체 ★ - 사진/그림/이미지 (= img태그 = 이미지태그)
HTML_Objects JS - <ins> 객체 - 텍스트삽입표시 (= ins태그 = 인스태그 = 인서트태그)
HTML_Objects JS - <input type="button"> 객체 - button타입 input태그 (= 인풋버튼태그)
HTML_Objects JS - <input type="checkbox"> 객체 ★ - checkbox타입 input태그 (= 인풋…
HTML_Objects JS - <input type="color"> 객체 - color타입 input태그 (= 인풋컬러태그) ※ …
HTML_Objects JS - <input type="date"> 객체 - date타입 input태그 (= 인풋데이트태그) ※ 날…
HTML_Objects JS - <input type="datetime"> 객체 - datetime타입 input태그 (= 인풋데이…
HTML_Objects JS - <input type="datetime-local"> 객체 - datetime-local타입 inp…
HTML_Objects JS - <input type="email"> 객체 - email타입 input태그 (= 인풋이메일태그)
HTML_Objects JS - <input type="file"> 객체 ★ - file타입 input태그 (= 인풋파일태그) ※ …
HTML_Objects JS - <input type="hidden"> 객체 ★ - hidden타입 input태그 (= 인풋히든태그…
HTML_Objects JS - <input type="image"> 객체 ★ - image타입 input태그 (= 인풋이미지태그)…
HTML_Objects JS - <input type="month"> 객체 - month타입 input태그 (= 인풋먼스태그) ※ …
HTML_Objects JS - <input type="number"> 객체 - number타입 input태그 (= 인풋넘버태그) …
HTML_Objects JS - <input type="password"> 객체 - password타입 input태그 (= 인풋패스…
HTML_Objects JS - <input type="radio"> 객체 ★ - radio타입 input태그 (= 인풋라디오태그 …
HTML_Objects JS - <input type="range"> 객체 - range타입 input태그 (= 인풋레인지태그) ※…
HTML_Objects JS - <input type="reset"> 객체 - reset타입 input태그 (= 인풋리셋태그) ※ …
HTML_Objects JS - <input type="search"> 객체 - search타입 input태그 (= 인풋서치태그) …
57/67
목록
찾아주셔서 감사합니다. Since 2012