Animations are slowing the performance of web page

前端 未结 3 1110
天命终不由人
天命终不由人 2021-01-12 20:26

I have a single page website design in html, javascript and css. There are lots of images on the webpage and all have different-different animation effects according to thei

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-12 21:04

    Since it looks like you're only using animated pulse, and are already adding and removing the animated class, I'd highly suggest using CSS animations.

    CSS animations are rendered with the GPU and do not use the main thread like JavaScript does. They're super smooth and performant!

    Check out this Codepen I found on Google creating a pulsing animated icon: https://codepen.io/igorsheg/pen/MBpwGw

提交回复
热议问题