Gif not animating on reload

Hello, I’ve set up my hero section with an animated .GIF and a couple of headings that fade in after the animation is complete. However, the .GIF doesn’t animate on reload. It’s annoying that it doesn’t animate, but what is worse is that the other elements seem to take forever to fade in. Is there a way to force the .GIF to animate ever time the page is reloaded?
Thanks

Hey Oriol,

Thanks for reaching out!

The reason why the .GIF didn’t animate after reloading the page because the browser already have the cache version of .GIF file. This is a common issue using the .GIF file. You may check these articles.

Or you can try holding shift and refreshing, and see if it works.

Hope that helps.

Thanks for the quick reply.
Which of the 4 solutions on the second link would be easier to implement? Should I do it on the “Page CSS” section?

Hello @Oriol,

You can easily apply the Solution #3.

The code on the given page serves as an example code. Feel free to modify it when needed. Please note that custom coding is beyond the scope of our support. You will have to maintain any custom coding to make sure that it will still work after any updates or does not create any issues or incompatibility in the future.

Thank you for your understanding.

Thanks Renuel! I was able to make it work.

For anyone who needs it:

I had to use the “Classic Image” element (on the regular “Image” element the “ID” [required for this to work] is outputted to a container [the images "parent] so it doesn’t work), and then, immediately after, placed a “Raw Content” element where I placed the code. You do have to select a source image for the Classic Image element, otherwise it is omitted from the front-end. You also need to give it the correct ID (in the example it’s “gif”)

The code I used was this one :
<script>document.getElementById('gif').src="path_to_picture.gif?a="+Math.random()</script>

You are most welcome, @Oriol.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.