用<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>

解决方案 »

  1.   

    我曾经做过 但是貌似不是主流方法 就是通过在子页面使用JS调整父页面的IFRAME 的长和宽..当然了 应该有正常些的方法的..
      

  2.   


    是<frame>,貌似和<iframe>还有些区别
      

  3.   

    <iframe  id="msgContent" name="msgContent"  src="" width="605"  height="0" frameborder="0"   scrolling="no" marginheight="0" marginwidth="0"  style="border-left:none; border-right:none; border-top:none; border-bottom:1 solid #000000"></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> 
      

  4.   


    那个.. 只要是能在HTML上设置宽高的 用这种方式大抵都能解决..
      

  5.   

    给你看我的frameset 看有用没有
    <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>
      

  6.   

    我也是网上找到的方法,但是我用在我的项目中了,可行,在框架集页面如下定义:<!-- 自适应高度框架 -->
    <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>
      

  7.   

    body{
              overflow:hidden;
          }
    页面加这个CSS看看
      

  8.   

    再给个js
    <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>
      

  9.   

    <%@ page contentType="text/html;charset=gbk"%>
    <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>  
    给楼主个例子 试试看
      

  10.   

    结帖了,最后还是用的<iframe>嵌套的<frame>,不过还是不理想。好象iframe高度可以设定,frame不可以的。