61,817
社区成员




<iframe id="sqiframe" name="sqiframe" src="<%=iframeurl%>" frameborder="0" width="100%" onload="AdjustHeight();"></iframe>
<script language="javascript" type="text/javascript">
function AdjustHeight()
{
if(sqiframe.document.body.scrollHeight+40 < 485)
{
document.getElementById("sqiframe").height = 485;//原560
}
else
{
document.getElementById("sqiframe").height=sqiframe.document.body.scrollHeight+40
}
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>iframe</title>
</head>
<body>
<script type="text/javascript">
function SetCwinHeight(){
var bobo=document.getElementById("bobo"); //iframe id
if (document.getElementById){
if (bobo && !window.opera){
if (bobo.contentDocument && bobo.contentDocument.body.offsetHeight){
bobo.height = bobo.contentDocument.body.offsetHeight;
}else if(bobo.Document && bobo.Document.body.scrollHeight){
bobo.height = bobo.Document.body.scrollHeight;
}
}
}
}
</script>
<iframe width="100%" id="bobo" onload="Javascript:SetCwinHeight()" height="1" frameborder="0" src="IFrame_myPage.aspx"></iframe>
其实很简单</body>
</html>
<script language="javascript" type="text/javascript">
//获取浏览器窗口宽
function getViewportInfoWidth()
{
var w = (window.innerWidth) ? window.innerWidth : (document.documentElement && document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.offsetWidth;
return w;
}
//获取浏览器窗口高
function getViewportInfoHeight()
{
var h = (window.innerHeight) ? window.innerHeight : (document.documentElement && document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.offsetHeight;
return h;
}
document.getElementById("iframe1").width=getViewportInfoWidth();
document.getElementById("iframe1").height=getViewportInfoHeight();
</script>
<frameset cols="167,6,100%" framespacing="0" frameborder="NO" border="0" name="main" id="main">
<frame src="LeftMenu.aspx?un=<%=username%>" name="leftmiddle" TOPMARGIN="0" LEFTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" FRAMEBORDER="0" border="0" bordercolor="#8AB8E9" scrolling="auto" >
<frame src="Frameset/framemiddle.htm" name="framemiddle" id="framemiddle" scrolling="NO" TOPMARGIN="0" LEFTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" FRAMEBORDER="0" border="0" bordercolor="#8AB8E9" >
<frame name="MainData" id="MainData" src="RigtMain.aspx?un=<%=username%>" TOPMARGIN="0" LEFTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" FRAMEBORDER="0" border="0" bordercolor="#8AB8E9" scrolling="yes">
</frameset>
<frame src="Frameset/bottom.htm" name="bottom" scrolling="NO" noresize>
</frameset>