F
F
Fqwd1232021-04-19 12:55:33
YouTube
Fqwd123, 2021-04-19 12:55:33

When deploying a video from YouTube, it throws it to the top of the page?

Such a problem: I have a carousel from a youtube video, when I click "Full screen" and then minimize the video, for some reason it throws me to the top of the page, and does not return to the section of the page where the videos are located. What is it connected with and how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-04-19
@Aleksandr-JS-Developer

This may be due to the fact that somewhere in the code it is bodyhung on overflow: hidden;to remove the ability to scroll on the page while the video is open.
But if you remove from body overflow: hidden;, then the page will rise up.
I solved this problem by locking the scroll with this good library: scroll-lock (github)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question