Search code examples
internet-explorer-8popupdimensions

How to retrieve actual window dimensions of a pop-up in IE8 ONLY? (NOT VIEWPORT)


I have a script that positions the popup at the bottom right corner of the users screen every time. However, IE8 could care less about the fact that there is more to the window than the viewport. How do I get the size of that in IE8?

var popUpWidth = window.outerWidth; // does not work in IE8!
var popUpHeight = window.outerHeight; // does not work in IE8!

Solution

  • IE8 doesn't have the outerWidth / outerHeight property, try instead:

       document.documentElement.clientHeight;
       document.documentElement.clientWidth;
    

    Here's an example http://james.padolsey.com/javascript/get-document-height-cross-browser/