S
S
Stanislav Cherenkov2014-12-08 12:25:56
JavaScript
Stanislav Cherenkov, 2014-12-08 12:25:56

How can you control GIF animation in Google Chrome?

Here: www.the-village.ru/village/situation/situation/171... (or on any other article on The Village) from time to time a banner "Concept of the week - a gadget apartment" appears.
bb7a78496f694723a3c9015ce41af029.png
The content of the element is a link and a gif image, no tricks. At the same time, the banner behaves in Google Chrome as follows: it shows different frames of the gif statically depending on the scroll position; when approaching the top or bottom of the page, it starts the animation from the last static frame.
In Firefox, Safari - does not work, there the gif is simply animated.
How can such behavior be implemented? The internet offers solutions with canvas, but it doesn't exist here .

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SagePtr, 2014-12-20
@stcherenkov

Apparently, this is a bug related to position: fixed. If you change the position to any other, then the animation works again. Fixed elements are drawn separately, and apparently chrome forgets to draw every frame, or tries to save resources.
When approaching the top and bottom borders, the script changes the style of this element, so the animation will be rendered normally.

S
Sergey Melnikov, 2014-12-08
@mlnkv

But there is no catch, they just track the scroll and change the picture periodically

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question