js取得ページの高さ、幅

1139 ワード

  var  s = "";
    s += "\r
:"+ document.body.clientWidth; s += "\r
:"+ document.body.clientHeight; s += "\r
:"+ document.body.offsetWidth +" ( )"; s += "\r
:"+ document.body.offsetHeight +" ( )"; s += "\r
:"+ document.body.scrollWidth; s += "\r
:"+ document.body.scrollHeight; s += "\r
:"+ document.body.scrollTop; s += "\r
:"+ document.body.scrollLeft; s += "\r
:"+ window.screenTop; s += "\r
:"+ window.screenLeft; s += "\r
:"+ window.screen.height; s += "\r
:"+ window.screen.width; s += "\r
:"+ window.screen.availHeight; s += "\r
:"+ window.screen.availWidth; alert(s);
モニター画面の高度変化
window.addEventListener("resize", function () {
//        (  /    ,  /    )
    changeLogoPosition();
}, false);