Last active
August 29, 2015 14:22
-
-
Save ahsankhatri/5ad3ba8ef256ba4a12a9 to your computer and use it in GitHub Desktop.
[JS] Find body overflow element..
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
/* | |
* Reference: https://css-tricks.com/findingfixing-unintended-body-overflow/ | |
* Uses: Run it on console.. | |
*/ | |
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