javascript,高度与宽度

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <script>
    function aa()
    {
        alert("网页可见区域宽: "+document.body.clientWidth+
        "\n网页可见区域高: "+document.body.clientHeight+
        "\n网页可见区域宽: "+document.body.offsetWidth+" (包括边线的宽)"+
        "\n网页可见区域高: "+document.body.offsetHeight+" (包括边线的高)"+
        "\n网页正文全文宽: "+document.body.scrollWidth+
        "\n网页正文全文高: "+document.body.scrollHeight+
        "\n网页被卷去的高: "+document.body.scrollTop+
        "\n网页被卷去的左: "+document.body.scrollLeft+
        "\n网页正文部分上: "+window.screenTop+
        "\n网页正文部分左: "+window.screenLeft+

        "\n浏览器可见高度: "+document.documentElement.clientHeight+
        "\n屏幕分辨率的高: "+window.screen.height+
        "\n屏幕分辨率的宽: "+window.screen.width+
        "\n屏幕可用工作区高度: "+window.screen.availHeight+
        "\n屏幕可用工作区宽度: "+window.screen.availWidth);
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <input value="tt" onclick="aa()" type=button />
    </div>
    </form>
</body>
</html>

posted on 2008-09-04 16:28  yaksea  阅读(384)  评论(0编辑  收藏  举报