본문 바로가기

웹표준/Performance & Intergration

8. requestAnimationFrame ()

window.requestAnimationFrame()은 window객체에 정의되어있다.

이는 WebGL과 함께 제공되며 지정된 함수의 호출을 다른 연산에 방해 주지않고 최대한 빨리 호출해준다.

화면에서 애니메이션을 업데이트 할 준비가 될 때마다 window.requestAnimationFrame()를 호출해야한다.

 

window.requestAnimationFrame ( 콜백함수 );

 

- 콜백함수 : next repaint를 하기위해 애니메이션을 업데이트 할때 호출 할 함수.

 

'웹표준 > Performance & Intergration' 카테고리의 다른 글

6. hasFocus()  (0) 2020.04.17
5. HTML요소의 드래그&드랍 API  (0) 2020.04.17
4. contenteditable 속성  (0) 2020.04.17
3. history API  (0) 2020.04.17
2. XMLHttpRequest (XHR)  (0) 2020.04.17