Last active
May 17, 2020 01:42
-
-
Save paalwilliams/c0d9d069c4a3fd01110ea9afec951732 to your computer and use it in GitHub Desktop.
find and console log elements overflowing the page (horizontal scroll)
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
//Console log elements wider than page | |
var docWidth = document.documentElement.offsetWidth; | |
[].forEach.call( | |
document.querySelectorAll('*'), | |
function(el) { | |
if (el.offsetWidth > docWidth) { | |
console.log(el); | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment