iframe 自动调节高度 ,而且不需要滚动条的功能总结
<!--自动调节高度 ,而且不需要滚动条的功能-->
var win=document.getElementById(obj);
if (win && !window.opera)
{
if (win.contentDocument && win.contentDocument.body.offsetHeight)
win.height = win.contentDocument.body.offsetHeight;
else if(win.Document && win.Document.body.scrollHeight)
win.height = win.Document.body.scrollHeight;
}
}
<iframe src="<%=basePath%>/main.jsp" name="main" width="100%"
height="100%" frameborder="0" scrolling="no" id="win"
onload="javascript:SetWinHeight(this.id);" />
<!-- 以下处理自动调节后页面 从新布局后 内容被覆盖的问题 -->
<body onload="setInterval('ResetHeight()', 100);">
function ResetHeight()
{
parent.document.all("win").height = parseInt(document.body.scrollHeight) + 8;
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载