Created
November 3, 2018 18:57
-
-
Save Dexdot/e47f32cb247ed86dcf88e9689cae8ddf to your computer and use it in GitHub Desktop.
scrollbar-width.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const outer = document.createElement('div'); | |
| const inner = document.createElement('div'); | |
| outer.style.overflow = 'scroll'; | |
| document.body.appendChild(outer); | |
| outer.appendChild(inner); | |
| const scrollbarWidth = outer.offsetWidth - inner.offsetWidth; | |
| document.body.removeChild(outer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment