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 findBreakoutElem(rootElem = document.body) { | |
function checkElemWidth(elem) { | |
if (elem.clientWidth > window.outerWidth) { | |
console.log("The following element has a larger width than the window's outer width"); | |
console.log(elem); | |
console.log('<-------------------------------------------------------------------->'); | |
} else if (elem.scrollWidth > window.outerWidth) { | |
console.log("The following element has a larger width than the window's scroll width"); | |
console.log(elem); | |
console.log('<-------------------------------------------------------------------->'); |