E
E
Emmet12021-06-14 20:33:42
css
Emmet1, 2021-06-14 20:33:42

How to animate a strip while scrolling?

There are two blocks. Initially, there is nothing between them, an empty space.

The task is to make a normal stripe that, when scrolling, will stretch from the blue block to the gray one. (when the screen with blocks appears in the field of view).

60c792e47ecc8510751673.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aricus, 2021-06-15
@Aricus

You need to add a stripe block, zero height add a height to the transition. When scrolling in js, add a class with the desired height to it, and remove it after a while setTimeout. You will also need to add a label so that several consecutive scrolls do not crash.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question