R
R
Roman Rakzin2021-01-02 08:51:21
Angular
Roman Rakzin, 2021-01-02 08:51:21

How to make an animation when scrolling to a certain element in angular?

How can you play an animation on scrolling to an element in Angular without crutches?
How will it work - repeatedly each time, if you return again or once?
What will be the behavior if the page has already been scrolled to a certain point and the page is reloaded, and the mouse wheel did not move at the same time? - does the onScroll event still work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Kadyrov, 2022-01-31
@Ahmad66617

Very simple - here ( https://angdev.ru/doc/angular-animation-part-1/ ) - that is, you write animations with all the little things and turn it on when you initialize the page (component) - it will be one-time, but if for example, through the IntersectionObserver API or HostListener to track the scroll to the top of the page, then you can restart the callback.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question