我的页面是个框架集,分为左(leftFrame)右(rightFrame),右(rightFrame)边是上(rTopFrame)下(rBottomFrame)。
rBottomFrame 在开始时隐藏的,在点击上面页面时才会弹起来。
在rTopFrame 中
<table>
    <tr><td>导航</td></tr>
    <tr><td><iframe>内容</iframe></td></tr>
    <tr><td><div>翻页</div></td></tr>
</table>
现在是要翻页始终在页面最底部,面“内容”那一行高度也要跟着窗口大小改变而改变。
我现在是这样做的
    <tr><td style="width: expression(document.body.clientWidth); height: expression(document.body.clientHeight-65);"><iframe>内容</iframe></td></tr>
这样写比较有效,但是在ie6,会经常死机,这怎么办呀。如果用JS写,怎么写呀。而且有好多这样的页面是这样。

解决方案 »

  1.   

    不知道这种效果是不是楼主想要的,下面的代码做了个例子,请楼主参考:<html>
    <head>
    <title></title>
    <script language="javascript">
    function winSize() {
    var width = document.getElementById("icontent").width;
    var height = document.getElementById("icontent").height
    document.getElementById("content").width= width;
    document.getElementById("content").height= height;
    }
    </script>
    </head><body onload="winSize();">
    <table>
        <tr> <td>导航 </td> </tr>
        <tr> <td id="content"> <iframe id="icontent">内容</iframe></td> </tr>
        <tr> <td> <div>翻页 </div> </td> </tr>
    </table> 
    </body>
    </html>
      

  2.   

    我做了一个简单的例子。
    是基于jquery的。<!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" />
    <script language="javascript" src="js/jslib/jquery.js"></script>
    <title>borderLayout-Test</title>
    <style>
    body,html{ margin:0; padding:0; height:100%}
    body{font:Arial, Helvetica, sans-serif; font-size:12px; color:#000000}
    div{ padding:0; margin:0}
    #north{ background:#FF0000; height:50px; width:100%}
    #south{ background:#0099FF; height:50px; width:100%}
    #center{ background:#00FF99;width:100%}
    </style></head><body><div id="north"></div>
    <div id="center"></div>
    <div id="south"></div><script language="javascript">

    //body onload事件

    $(document).ready(function(){

    initLayout()


    });

    /*
    之所以要用setTimeout函数,完全是用来模拟onresizeend函数,由于浏览器在改变
    大小时获得高度和宽度都是在容器没有变化前的大小,但是延迟一段时间执行的时候就可以获得容器改变之后的大小,并开始操作
    */
    var oTime;
    window.onresize = function(){
    if (oTime)
    {
    clearTimeout(oTime);//取消循环
    }
    oTime = setTimeout("initLayout()", 100); //延迟100毫秒执行,并且定制一个标志位,如果标志位存在则停止
    } //加载页面框架的函数
    function initLayout(){

    var windowW = $(window).width();
    var windowH = $(window).height();


    $("#center").height(windowH-$("#north").height()-$("#south").height());


    }
    </script>
    </body>
    </html>
      

  3.   

    LZ最好不要使用expression
    支持1L的
      

  4.   

    我现在是用1楼的方法,但是content不跟着实时变化,得刷新一下它。
      

  5.   

    我结合了前两位高手的意见,现在是这样
     var oTime; 
    window.onresize = function(){ 
    if (oTime) 

    clearTimeout(oTime);//取消循环 

    oTime = setTimeout("doinit()", 5); //延迟100毫秒执行,并且定制一个标志位,如果标志位存在则停止 

     function  doinit()
     {
         window.document.getElementById("xcpmTable").style.width=document.body.clientWidth;
         window.document.getElementById("xcpmTable").style.height=document.body.clientHeight-100;
     window.document.getElementById("midTd").style.width=document.body.clientWidth;
     window.document.getElementById("midTd").style.height=document.body.clientHeight-document.getElementById('search').offsetHeight-125;
     window.document.getElementById("midDiv").style.width=document.body.clientWidth;
     window.document.getElementById("midDiv").style.height=document.body.clientHeight-document.getElementById('search').offsetHeight-125;
     }但总是有缓冲的感觉,就是点下收缩,窗口收上去了,但得等1秒里面的滚动条才跟上来。