Skip to content

Instantly share code, notes, and snippets.

@chrisgoddard
Created October 12, 2015 22:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chrisgoddard/045412e51ad9dd70dbfc to your computer and use it in GitHub Desktop.
Save chrisgoddard/045412e51ad9dd70dbfc to your computer and use it in GitHub Desktop.
Find unintended body overflow
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