Last active
April 26, 2018 22:53
-
-
Save luislobo14rap/f810bd99da8af1b34113592170fb1870 to your computer and use it in GitHub Desktop.
This file contains 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
/* https://davidwalsh.name/detect-scrollbar-width */ | |
.scrollbar-y-measure{width:100px;height:100px;overflow:scroll;position:absolute;top:-9999px} |
This file contains 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
/* https://davidwalsh.name/detect-scrollbar-width */ | |
function scrollbarYWidth(){return scrollDiv.offsetWidth-scrollDiv.clientWidth}let scrollDiv=document.createElement('div');scrollDiv.className='scrollbar-y-measure',document.body.appendChild(scrollDiv); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment