document.body.clientHeight 和 document.documentElement.clientHeight的区别
document.body.clientWidth ==> BODY对象宽度
document.body.clientHeight ==> BODY对象高度
document.documentElement.clientWidth ==> 可见区域宽度
document.documentElement.clientHeight ==> 可见区域高度
实例:
var hi = document.documentElement.clientHeight;
var wi = document.documentElement.clientWidth;
var wi = wi-2;
var hi = hi-2;
var de = wi+"px";
var ddd=hi+"px";
var dd = document.getElementById("001");
dd.style.width=de;
dd.style.height=ddd;
dd.style.borderLeft="1px solid #4d6490";
dd.style.borderRight="1px solid #4d6490";
dd.style.borderBottom="2px solid #4d6490";
posted on 2013-07-05 16:43 TrustNature 阅读(108) 评论(0) 编辑 收藏 举报