分享java帶來的快樂

          我喜歡java新東西

          js 窗口寬度和高度

          <body><SCRIPT LANGUAGE="JavaScript">
          var  s = "";
          s += "\r\n網頁可見區域寬:"+ document.body.clientWidth;
          s += "\r\n網頁可見區域高:"+ document.body.clientHeight;
          s += "\r\n網頁可見區域寬:"+ document.body.offsetWidth  +" (包括邊線和滾動條的寬)";
          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;
          s += "\r\n你的屏幕設置是 "+ window.screen.colorDepth +" 位彩色";
          s += "\r\n你的屏幕設置 "+ window.screen.deviceXDPI +" 像素/英寸";
          alert(s);
          </SCRIPT>

          posted on 2009-04-09 00:19 強強 閱讀(757) 評論(1)  編輯  收藏 所屬分類: web技巧

          評論

          # re: js 窗口寬度和高度 2010-03-08 15:51 rocky

          太有用了,多謝了  回復  更多評論   

          主站蜘蛛池模板: 子洲县| 华容县| 桂林市| 蕉岭县| 武夷山市| 玉树县| 遵化市| 平顶山市| 彭水| 孟连| 怀安县| 普宁市| 新邵县| 江北区| 云安县| 仙游县| 衢州市| 乐东| 梁河县| 肥城市| 泰来县| 仁化县| 山西省| 贵州省| 襄城县| 平乡县| 德庆县| 克山县| 宾阳县| 容城县| 长汀县| 青神县| 朝阳市| 丰顺县| 昌宁县| 红桥区| 襄垣县| 金寨县| 岱山县| 六安市| 五常市|