用<frameset>和<frame>做的页面,我想让每个frame都自动适应他所包含网页的高度,不出现上下滚动条和左右滚动条,设置属性好象不行。应该怎么做呢。
查了好多资料试了都没效果呢
请高手指教代码如下:
<frameset rows="92,28,*,26" cols="*" frameborder="0" style="margin:0 auto; width:1024px; text-align:center;">
<frame src="/control/header.action" noresize="noresize" scrolling="no" marginheight="10" marginwidth="0"/>
<frame src="/control/admintop.action" noresize="noresize" scrolling="no" marginheight="0"/>
<frameset rows="*" cols="146,*">
<frame name="pageLeft" src="/control/adminleft.action" marginheight="0" marginwidth="0" scrolling="no" />
<frame name="pageRight" src="/admin/cardList.action" noresize marginheight="0" marginwidth="0" scrolling="auto" frameborder="0" />
</frameset>
<frame src="/control/end.action" marginheight="0" scrolling="no" style="width:100%;"/>
</frameset>
查了好多资料试了都没效果呢
请高手指教代码如下:
<frameset rows="92,28,*,26" cols="*" frameborder="0" style="margin:0 auto; width:1024px; text-align:center;">
<frame src="/control/header.action" noresize="noresize" scrolling="no" marginheight="10" marginwidth="0"/>
<frame src="/control/admintop.action" noresize="noresize" scrolling="no" marginheight="0"/>
<frameset rows="*" cols="146,*">
<frame name="pageLeft" src="/control/adminleft.action" marginheight="0" marginwidth="0" scrolling="no" />
<frame name="pageRight" src="/admin/cardList.action" noresize marginheight="0" marginwidth="0" scrolling="auto" frameborder="0" />
</frameset>
<frame src="/control/end.action" marginheight="0" scrolling="no" style="width:100%;"/>
</frameset>
是<frame>,貌似和<iframe>还有些区别
<script type="text/javascript">
function reinitIframe(){
var iframe = document.getElementById("msgContent");
try{
var bHeight = iframe.contentWindow.document.body.scrollHeight;
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
var height = Math.max(bHeight, dHeight);
iframe.height = height;
}catch (ex){}
}
window.setInterval("reinitIframe()", 200);
</script>
那个.. 只要是能在HTML上设置宽高的 用这种方式大抵都能解决..
<frameset cols="*,1020,*" border="0" framespacing="0" frameborder="no">
<frame noresize="noresize">
<frameset rows="100,*,25" border="0" framespacing="0">
<frame src="/SEHRS/toHead.do" scrolling="no" noresize="noresize" name="headFrame">
<frameset cols="191,*" framespacing="0">
<frameset rows="*,109" framespacing="0">
<frame src="/SEHRS/toTree.do" name="treeFrame" marginheight="0" marginwidth="0" scrolling="no">
<frame src="/SEHRS/toShortcut.do" name="shortcutFrame" scrolling="no" noresize="noresize">
</frameset>
<frame src="/SEHRS/toMain.do" name="mainFrame" marginheight="0" marginwidth="0">
</frameset>
<frame src="/SEHRS/toBottom.do" scrolling="no" noresize="noresize" name="bottomFrame">
</frameset>
<frame scrolling="no">
<noframes>
<body>
你的浏览器不支持框架,请下载新版浏览器!
</body>
</noframes>
</frameset>
<iframe src="ec/claimsearch/insurSearch.jsp" name="rightFrame" id="rightFrame" width="98%" height="100%" scrolling="auto" frameborder="0" valign="top" onload="this.height=this.contentWindow.document.body.scrollHeight+100;">
</iframe>
overflow:hidden;
}
页面加这个CSS看看
<script type="text/javascript">
function reinitIframe(){
var iframe = document.getElementById("ifr");
try{
var bHeight = iframe.contentWindow.document.body.scrollHeight; iframe.height = bHeight;
}catch (ex){}
}
window.setInterval("reinitIframe()", 200);
</script>
<HTML><HEAD><TITLE>管理后台</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<FRAMESET rows=28,*>
<FRAME name=toolbar src="/easy/manager/top.jsp" noResize scrolling=no target="contents">
<FRAMESET border=6 name=bottom_frame frameSpacing=6 borderColor=menu cols=-10,*>
<FRAME name=dir src="/easy/manager/left.jsp" scrolling=no target="main">
<FRAME name=main src="/easy/manager/info/today.jsp">
</FRAMESET>
<NOFRAMES>
<body>
<p>此网页使用了框架,但您的浏览器不支持框架。</p>
</body>
</NOFRAMES>
</FRAMESET>
</HTML>
给楼主个例子 试试看