CaptainZero
CaptainZero

Reputation: 1491

SVG Animation hide or stop after page load?

I am displaying an SVG / CSS loading animation on page load and I usually hide the <div> that contains the SVG / CSS after the page load.
Is there any performance issue there when we hide the <div> without stopping animation? Is it necessary to stop animation after hiding the SVG animation? Both in case of SVG and CSS animation?

Upvotes: 0

Views: 564

Answers (1)

scraaappy
scraaappy

Reputation: 2886

It depends how you hide your element and how your animation works. If it's pure css and if you specify display:none, the browser have the information not to render the specified element. If you hide it with another element above it, the browser will still attempt to render it. In all case, if you have a script to manage animation, you have to stop it. However if you really want to be sure : https://dev.webonomic.nl/how-to-disable-css-transforms-transistions-and-animations/comment-page-1

Upvotes: 1

Related Questions