能力有限:问个问题,标签相对页面高度,是怎么写?
- 鼠标的横坐标,X轴: event.clientX;
- 鼠标的竖坐标,Y轴: event.clientY;
- 网页可见区域宽: document.body.clientWidth;
- 网页可见区域高: document.body.clientHeight;
- 网页可见区域高(包括边线的宽): document.body.offsetHeight;
- 网页正文全文宽: document.body.scrollWidth;
- 网页正文全文高: document.body.scrollHeight;
- 网页被卷去的左: document.body.scrollLeft;
- 网页正文部分上: window.screenTop;
- 网页正文部分左: window.screenLeft;
- 屏幕分辨率的高: window.screen.height;
- 屏幕分辨率的宽: window.screen.width;
- 屏幕可用工作区高度: window.screen.availHeight;
- 屏幕可用工作区宽度: window.screen.availWidth;
- 标签内部高度: divHg.clientHeight; divHg为对象: var divHg = document.getElementById("xxxxx");
- 标签内部高度: divWd.clientWidth; divWd为对象: var divWd = document.getElementById("xxxxx");
=================================Script使用例子===================================
var divHg = document.getElementById("tit");//标签id
var divWd = document.getElementById("tit");//标签id
var s ="鼠标的横坐标,X轴:"+ event.clientX;
s += "
鼠标的竖坐标,y轴:"+ event.clientY;
s += "
网页可见区域宽 :"+ document.body.clientWidth;
s += "
网页可见区域高:"+ document.body.clientHeight;
s += "
网页可见区域高:"+ document.body.offsetHeight +" (包括边线的宽)";
s += "
网页正文全文宽:"+ document.body.scrollWidth;
s += "
网页正文全文高:"+ document.body.scrollHeight;
s += "
网页被卷去的高:"+ document.body.scrollTop;
s += "
网页被卷去的左:"+ document.body.scrollLeft;
s += "
网页正文部分上:"+ window.screenTop;
s += "
网页正文部分左:"+ window.screenLeft;
s += "
屏幕分辨率的高:"+ window.screen.height;
s += "
屏幕分辨率的宽:"+ window.screen.width;
s += "
屏幕可用工作区高度:"+ window.screen.availHeight;
s += "
屏幕可用工作区宽度:"+ window.screen.availWidth;
s += "
标签内部高度:"+ divHg.clientHeight;
s += "
标签内部宽度:"+ divWd.clientWidth;
alert(s);