I have a simple vue ponent that will display a preloader when some images are loaded or changes. It's working fine, but I'm not able to disable the overflow of the document body when the ponent is displayed. Is there a way in Javascript to select the body and set the overflow to hidden? I'm not expert in vanilla javascript.
I have a simple vue ponent that will display a preloader when some images are loaded or changes. It's working fine, but I'm not able to disable the overflow of the document body when the ponent is displayed. Is there a way in Javascript to select the body and set the overflow to hidden? I'm not expert in vanilla javascript.
Share Improve this question asked May 21, 2020 at 13:57 guggioguggio 2211 gold badge5 silver badges19 bronze badges 1-
1
To get the body just use
document.body
– VLAZ Commented May 21, 2020 at 13:59
1 Answer
Reset to default 6You can use querySelector
to select any item in your DOM. Here is the mdn_link for details
If you want to select the body
then simply you can use document.body