1

I am looking for an advice to do some “animation” on my home page on a WordPress website, I have a gif playing once on my home page, I would like to change the background color, only at a specific frame of the gif. When the gif hit its 80 frame, the background should switch from white to black. Can it be done with javascript ? Could you direct me on how to do that ? Thank you very much

  • Why not use a video instead? They are usually smaller than equivalent animated GIFs, plus the HTML video element gives you far more control. – evolutionxbox Jun 19 '17 at 11:06
  • [Check this Link](https://stackoverflow.com/questions/2385203/can-you-control-gif-animation-with-javascript) – h.munawar Jun 19 '17 at 11:07

1 Answers1

1

A gif with 80 frames or more is not really good for your website. I strongly recommend using a plugin like Slider Revolution to create animations or use other methods like Animate It! A video would be another possible option too. You can convert your gif into video with the help of some online tools.

Ali Seivani
  • 496
  • 3
  • 21
  • Thanks for your answer, I can use a video, sure, it's even better for me, but how can I change the background color at a specific time of this video ? I am gonna check your suggestions, any more help would be appreciate, Thanks a lot! – Thomas Duquet Jun 19 '17 at 22:04
  • You can create your gif in Photoshop (https://www.youtube.com/watch?v=ot5GwpQPjF0) and change the color of background for specific layer or use more advanced tools like AfterEffects. If you open a gif in Photoshop you will have multiple layers. Select the layer you want to change the background color and edit it using Photoshop itself. – Ali Seivani Jun 21 '17 at 03:53