admin管理员组文章数量:1431918
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
本文标签: vuejsHow to select document body in JavascriptStack Overflow
版权声明:本文标题:vue.js - How to select document body in Javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745594360a2665385.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论