Preventing page scroll using JavaScript

Published: 20 November 2021
on channel: Atihar Hossen Mahir
597
3

If you ever need to temporally disable scrolling on a specific scrollable element, then you will need to use JavaScript or CSS for it. Depending on your use case, you can choose between JavaScript and CSS solutions. Although in general terms the CSS solution is the most adopted one, JavaScript offers you a bit more of control and flexibility and allows you to decide how exactly you want to stop the scrolling.
I have used JS in this site to stop scrolling on video playing/modal on.


On this page of the site you can watch the video online Preventing page scroll using JavaScript with a duration of hours minute second in good quality, which was uploaded by the user Atihar Hossen Mahir 20 November 2021, share the link with friends and acquaintances, this video has already been watched 597 times on youtube and it was liked by 3 viewers. Enjoy your viewing!