top、clientTop、scrollTop、offsetTop


图例表明以下:

top、clientTop、scrollTop、offsetTop offsetTop scrollTop clientTop top CSS/HTML  第1张

  51windows.Net 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;alert(s);
[Ctrl A 选中 注:引进外界Js需再更新一下网页页面才可以实行]