Finding Window Dimensions with Javascript

December 13, 2008

Sometimes you may want to find the dimensions of the user’s browser window. Below is a list of the propertiesthat are accessible with different browsers. Traditionally, window.innerWidth/window.innerHeight is the most widely accepted way to obtain these values, however, there is deviation between IE 4 and IE 6+ in “standards compliant mode.” Below, I have listed the different ways to find the window height and width. Non-IE Browsers window.innerWidth window.innerHeight IE 6+ in “standards compliant mode” document.documentElement.clientWidth document.docuementElement.clientHeight IE... [Read the full story]