1 year ago

#382050

test-img

Artemixed

Is there a way to stop autoplay on .gifs in a backgroundImage?

For a project I have a div which contains an image <div class="postCard" style="background-image: url(<?=$url ?? "./style/assets/placeHolder.png"?>)"></div>

As of now users can upload gifs as an background image as well, but it's not user friendly to play dozens of gifs at the same time. For this reason I want to disable autoplay of these .gifs.

I can't find a way to do this natively and the existing solutions such as libgif JS don't allow for background images.

is there any other way I can solve this problem without having a stock image to replace them or removed the BackgroundImage?

javascript

html

css

image

gif

0 Answers

Your Answer

Accepted video resources