<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title>欢迎登录 管理后台</title>
</head>
<framesetborder="0"framespacing="0"rows="132,*,38"frameborder="0"cols="*">
<framename="topframe"marginwidth="0"src="managetop.aspx"mce_src="managetop.aspx"frameborder="0"noresize="noresize"scrolling="no">
<framesetborder="0"framespacing="0"frameborder="0"cols="188,*">
<framename="leftframe"src="manageleft.aspx"mce_src="manageleft.aspx"frameborder="0"noresize="noresize">
<framename="main"src="managemain.htm"mce_src="managemain.htm"frameborder="0">
</frameset>
<framename="footframe"src="managefooter.aspx"mce_src="managefooter.aspx"frameborder="0"noresize="noresize"scrolling="no">
</frameset>
</html>
---------------------------------------------华不华丽与我无关---------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url=http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]">
<htmlxmlns="[url=http://www.w3.org/1999/xhtml]http://www.w3.org/1999/xhtml[/url]"lang="gb2312">
<head>
<head>
<title> 代码实例:关于clientWidth、offsetWidth、clientHeight、offsetHeight的测试比较 </title>
<metahttp-equiv="content-type"content="text/html; charset=gb2312"/>
<metaname="author"content="枫岩,CnLei.y.l@gmail.com">
<metaname="copyright"content="[url=http://www.cnlei.com]http://www.cnlei.com[/url]"/>
<metaname="description"content="关于clientWidth、offsetWidth、clientHeight、offsetHeight的测试比较"/>
<mce:styletype="text/css"media="all"><!--
body {font-size:14px;}
a,a:visited {color:#00f;}
#Div_CnLei {
width:300px;
height:200px;
padding:10px;
border:10px solid #ccc;
background:#eee;
font-size:12px;
}
#Div_CnLei p {margin:0;padding:10px;background:#fff;}
--></mce:style><styletype="text/css"media="all"mce_bogus="1">body {font-size:14px;}
a,a:visited {color:#00f;}
#Div_CnLei {
width:300px;
height:200px;
padding:10px;
border:10px solid #ccc;
background:#eee;
font-size:12px;
}
#Div_CnLei p {margin:0;padding:10px;background:#fff;}</style>
<mce:scripttype="text/javascript"><!--
function Obj(s){
return document.getElementById(s)?document.getElementById(s):s;
}
function GetClientWidth(o){
return Obj(o).clientWidth;
}
function GetClientHeight(o){
return Obj(o).clientHeight;
}
function GetOffsetWidth(o){
return Obj(o).offsetWidth;
}
function GetOffsetHeight(o){
return Obj(o).offsetHeight;
}
// --></mce:script>
</head>
<body>
<p>点击下面的链接:</p>
<divid="Div_CnLei">
<p><ahref="http://bbs.chinaunix.net/"mce_href="http://bbs.chinaunix.net/""javascript:alert(GetClientWidth('Div_CnLei'));">GetClientWidth();</a><ahref="http://bbs.chinaunix.net/"mce_href="http://bbs.chinaunix.net/""javascript:alert(GetClientHeight('Div_CnLei'));">GetClientHeight();</a></p>
<p><ahref="http://bbs.chinaunix.net/"mce_href="http://bbs.chinaunix.net/""javascript:alert(GetOffsetWidth('Div_CnLei'));">GetOffsetWidth();</a><ahref="http://bbs.chinaunix.net/"mce_href="http://bbs.chinaunix.net/""javascript:alert(GetOffsetHeight('Div_CnLei'));">GetOffsetHeight();</a></p>
</div>
<divid="Description">
<p><strong>IE6.0、FF1.06+:</strong><br/>
clientWidth = width + padding = 300+10×2 = 320<br/>
clientHeight = height + padding = 200+10×2 = 220<br/>
offsetWidth = width + padding + border = 300+10×2+10×2= 340<br/>
offsetHeight = height + padding + border = 200+10×2+10×2 = 240</p>
<p><strong>IE5.0/5.5:</strong><br/>
clientWidth = width - border = 300-10×2 = 280<br/>
clientHeight = height - border = 200-10×2 = 180<br/>
offsetWidth = width = 300<br/>
offsetHeight = height = 200</p>
</div>
</body>
</html>