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

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

          Posted on 2008-07-12 16:56 semovy 閱讀(532) 評論(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>
          主站蜘蛛池模板: 张家港市| 纳雍县| 抚顺市| 汤原县| 咸阳市| 大连市| 突泉县| 陈巴尔虎旗| 新宾| 宁强县| 喀喇沁旗| 历史| 东兰县| 郧西县| 铁岭县| 万州区| 莒南县| 青海省| 郁南县| 宽甸| 睢宁县| 望都县| 会昌县| 白沙| 平山县| 中牟县| 湘潭市| 墨江| 子洲县| 天镇县| 鄂托克旗| 扶余县| 阳泉市| 桃园县| 鄂尔多斯市| 盘锦市| 承德市| 阳江市| 湘潭市| 定州市| 华阴市|