Find an element which is adding a horizontal sliding bar to the page

This is the cool article which explains how to troubleshoot: https://css-tricks.com/findingfixing-unintended-body-overflow/

Or you may use the following code and add it to the Console (Developer Tools).

var all = document.getElementsByTagName(“*”), i = 0, rect, docWidth = document.documentElement.offsetWidth;
for (; i < all.length; i++) {
    rect = all[i].getBoundingClientRect();
    if (rect.right > docWidth || rect.left < 0){
        console.log(all[i]);
    }
}

Comments

Leave a Reply