0
To leave well structured a page that will have the scrollbar disabled when a certain button is clicked, I think about setting an additional padding to the body com js, to compensate for the hidden scroll. I’ve been reading around that many browsers already have a standard width of 17px, but others have different specifications. What I need is a solution to detect the width of the native document scrollbar, take that value and add to the body.
$('body').css('padding-right', WidthDoScrollbar);
I am using the latest version of firefox. 60.0.1, on the console is giving this error:
TypeError: document.body is null
– John Quimera
Your tag
<script>
is at the end oftag
body? , this error may be causing because the script is running before loading the full HTML.– Laércio Lopes
Wow. What a detail! Now it worked. Thx.
– John Quimera