Created
August 17, 2016 11:28
-
-
Save SubZane/8aa5f7c7dc6060c7bca38ac9f26bd6aa to your computer and use it in GitHub Desktop.
Detects if there is a visible horizontal scrollbar
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
function hasVerticalScroll() { | |
var scrollHeight = document.body.scrollHeight; | |
var clientHeight = document.documentElement.clientHeight; | |
var hasVerticalScrollbar = scrollHeight > clientHeight; | |
return hasVerticalScrollbar; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment