Last active
January 28, 2025 14:24
-
-
Save BroFox86/edf9acb3a6b38fe708d84b7d48e131d9 to your computer and use it in GitHub Desktop.
[Detect scrollbars] #jsTrick
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 element = document.querySelector(".element"); | |
| const hasHorizontalScrollbar = element.scrollWidth > element.clientWidth; | |
| const hasVerticalScrollbar = element.scrollHeight > element.clientHeight; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment