P
P
Petr2016-06-23 10:35:51
gif
Petr, 2016-06-23 10:35:51

Autoplay gif on the site page, how?

How many times have I noticed autoplay gifs on pages, maybe there is a code?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dima, 2016-06-23
@CrazyFail

I can say, judging by the source code on Twitter, on the page instead of the *.gif itself, the (first) frame from it is inserted, and only then according to the user's actions (for example, when the picture is in the viewport zone, i.e. the user scrolled (scrolled) the static image is replaced with the original image *.gif
About how to process gif and "select" a frame from them, I think you need to look at ImageMagick or node.js packages, for example, because this process is carried out faster just on the server side.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question