请大家帮忙,我想通过通过javascript控制frameset的row值,在frameset里的row值我设的是rows="126,*,90",我想通过javascript得到!浏览器!显示区域的高度,用这个高度减去126,然后付给rows="126,*,90"里面的*。让如下代码的index.html网页显示出来的时候,这个*值就已经是浏览器显示区域的高度减去126了。现有的html页代码如下:(请大家回帖时帮忙,帮我把代码嵌到下面的代码中,我是生手,javascript和html的好多声明语句和语法规则不是很精通呢)<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title><frameset rows="126,*,90" cols="*" framespacing="0" frameborder="yes" border="5" bordercolor="#3300FF" >
<frame src="top.html" frameborder="yes" name="top" bordercolor="#FFFF00" noresize title="top" scrolling="no">
<frame src="middle.html" frameborder="yes" name="middle" bordercolor="#FF0000" noresize title="left">
<frame src="bottom.html" frameborder="yes" name="bottom" bordercolor="#FFFF00" noresize title="bottom" scrolling="no"></frameset><noframes></noframes></head><body>
</body>
</html>

解决方案 »

  1.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head><body>

        <frameset id="frameset" rows="126,*,90" cols="*" framespacing="0" frameborder="yes" border="5" bordercolor="#3300FF" >
        <frame src="top.html" frameborder="yes" name="top" bordercolor="#FFFF00" noresize title="top" scrolling="no">
        <frame src="middle.html" frameborder="yes" name="middle" bordercolor="#FF0000" noresize title="left">
        <frame src="bottom.html" frameborder="yes" name="bottom" bordercolor="#FFFF00" noresize title="bottom" scrolling="no">
        
        </frameset>
        
        <noframes></noframes>
    <script>
         var height = document.body.clientHeight || document.documentElement.clientHeight;
    var iframeset = document.getElementById('frameset');

    iframeset.rows = '126,' + (height - 126) + ',90';
    alert(iframeset.rows)
        </script>
    </body>
    </html>
      

  2.   

    这段代码我运行了,可是运行不同,是不是不应该把frameset的这套声明放到<body>里啊?
      

  3.   


    得放在body标签里,你直接用我的~·看看跟你哪写的不一样
      

  4.   

    在其中一个frame里面的js加个控制
    var topDocument = window.parent.document,
    el = topDocument.getElementById("frameId"),
    height = topDocument.body.clientHeight;
    el.setAttribute("rows","126," + (height - 126) + ",90");
      

  5.   

    MuBeiBei 和liangws能不能加你们QQ?