posts - 0, comments - 77, trackbacks - 0, articles - 356
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          得到頁面body區域內容的高度

          Posted on 2008-07-12 16:56 semovy 閱讀(540) 評論(0)  編輯  收藏 所屬分類: JavaScript
          <html>

          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
          <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
          <meta name="ProgId" content="FrontPage.Editor.Document">
          <title>New Page 1</title>
          </head>

          <body>

          <SCRIPT  LANGUAGE="JavaScript">  
          var    s  =  "";  
          s  +=  "\r\n網頁可見區域寬:"+  document.body.clientWidth;  
          s  +=  "\r\n網頁可見區域高:"+  document.body.clientHeight;  
          s  +=  "\r\n網頁可見區域高:"+  document.body.offsetWeight  +"  (包括邊線的寬)";  
          s  +=  "\r\n網頁可見區域高:"+  document.body.offsetHeight  +"  (包括邊線的寬)";  
          s  +=  "\r\n網頁正文全文寬:"+  document.body.scrollWidth;  
          s  +=  "\r\n網頁正文全文高:"+  document.body.scrollHeight;  
          s  +=  "\r\n網頁被卷去的高:"+  document.body.scrollTop;  
          s  +=  "\r\n網頁被卷去的左:"+  document.body.scrollLeft;  
          s  +=  "\r\n網頁正文部分上:"+  window.screenTop;  
          s  +=  "\r\n網頁正文部分左:"+  window.screenLeft;  
          s  +=  "\r\n屏幕分辨率的高:"+  window.screen.height;  
          s  +=  "\r\n屏幕分辨率的寬:"+  window.screen.width;  
          s  +=  "\r\n屏幕可用工作區高度:"+  window.screen.availHeight;  
          s  +=  "\r\n屏幕可用工作區寬度:"+  window.screen.availWidth;  
          alert(s);  
          </SCRIPT>

          </body>

          </html>
          主站蜘蛛池模板: 仙游县| 蓝山县| 堆龙德庆县| 新泰市| 合水县| 安乡县| 德阳市| 栾城县| 洪湖市| 水城县| 马尔康县| 昆明市| 西贡区| 锡林郭勒盟| 桃江县| 霍山县| 阳谷县| 昌邑市| 灵璧县| 罗源县| 孙吴县| 横峰县| 霍州市| 米脂县| 英山县| 砀山县| 神木县| 文水县| 桑植县| 桃园市| 和平县| 阿拉善盟| 湖北省| 鄂托克旗| 固始县| 西乡县| 庆城县| 黄陵县| 贡觉县| 北碚区| 纳雍县|