A
A
Andrew2021-06-23 11:52:04
css
Andrew, 2021-06-23 11:52:04

Is it possible to infinitely increase css property with animation?

The question is, is it possible to create an animation that permanently increments a value, such as translateX by 10px?

The question is about keyframe animations in css. At the moment, I solved this problem through requestAnimationFrame, but it looks quite resource-intensive, because quite a few elements. Yes, they need to be infinitely automatically scrolled, the blocks inside them are generated automatically.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2021-06-23
@Stalker_RED

CSS animations require a start and end point, so it won't work indefinitely.
But you don't really need infinity, because the browser will break at about 34 million pixels. So you can set a fairly large number, for example 30 million, and choose the desired speed. And wait for crash reports from users who have run out of memory)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question