Performance of CSS Transitions vs. JS animation packages

后端 未结 4 499
攒了一身酷
攒了一身酷 2020-11-28 05:31

I\'m wondering is there any difference in performance of using CSS Transitions vs. any of the various JavaScript animation libraries? (script.aculo.us, sc

4条回答
  •  温柔的废话
    2020-11-28 06:14

    CSS animations have the advantage of being processed by the browser. Fast computations and optimizations are available. In my opinion web animations performance should be looked trough a "holistic" point of view. After all an animation, in terms of FPS, can not be faster then the browser refresh.

    The real performance level is given by the overall UI performance. A JS and a CSS animation can look similar. However CSS animations win since they do not block the UI thread.

    Stoyan Stefanov wrote and demo how CSS animations are put out of the UI thread: http://www.phpied.com/css-animations-off-the-ui-thread/

提交回复
热议问题