I am trying to find the full width of the page, I have followed lot of answers on SO but no luck
I have tried
$(document).width()
window.outerWidth
window.innerWidth
document.body.scrollWidth
document.body.clientWidth
I tried to get these values, in pages with horizontal scroll bar in the bottom and the values I get for all the above code are same console.log($(document).width(),window.outerWidth,window.innerWidth,document.body.scrollWidth,document.body.clientWidth)
output: 1366 1366 1366 1366 1366
I am trying to find width of old sharepoint pages and they are not properly designed, i.e some tables/images have huge width specified in inline style and they are not contained inside their parent containers
I even tried to find the element with maximum width
var maxwidth = 1300;
$("body *").each(function(){
if($(this).width()>maxwidth){
maxwidth = $(this).width();
}
})
console.log(maxwidth)
But it is not reliable. For example, in a page with no scroll bar the maxwidth was 2773
and it was 2000
for a page with scrollbar
Not sure what else can be done for getting the full width of the pages