HTML 페이지 크기 조회


var widthAvailable;
var heightAvailable;

function retrieveWidthAndHeight() {
    if (self.innerHeight) { //other than IE
        widthAvailable = self.innerWidth;
        heightAvailable = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict mode
        widthAvailable = document.documentElement.clientWidth;
        heightAvailable = document.documentElement.clientHeight;
    } else if (document.body) { // other IE (IE < 6)
        widthAvailable = document.body.clientWidth;
        heightAvailable = document.body.clientHeight;
    } else {
        widthAvailable = 320;
        heightAvailable = 320;
    }
}

Comments