I
I
Ilya Kunovskiy2021-03-24 13:02:42
JavaScript
Ilya Kunovskiy, 2021-03-24 13:02:42

When processing a scroll, scroll the page to the middle?

Hello, there was a problem, I have 5 sections, 100vh + 10px in height (for scrolling), they are displayed through v-if, I need that when the scroll handler fires (the section is flipped), this section is exactly in the middle.
I tried scrollTop, scrollTo, they work if the functions are allowed on the buttons, but they don't care when processing the scroll, tell me what to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WebEagle, 2021-03-24
@WebEagle

I think you should go here https://learn.javascript.ru/onscroll#predotvrasche...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question