请大家帮忙,我想通过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></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>
    <script>
    window.onload=function(){
    var h = document.body.clientWidth - 126;
    document.getElementById("f").rows = "126," + h;
    }
    </script>
    </head>
    <frameset id="f" 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>
    </html>
      

  2.   


    <!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>
    <script>
    window.onload=function(){
    var h;
    if (window.innerHeight != null) {
    h = window.innerHeight - 126;
    } else {
    h = document.documentElement.clientHeight;
    }
        document.getElementById("fs").rows = "126," + h + ",90";
        alert(document.getElementById("fs").rows);
    }
    </script>
    </head>
    <frameset id="fs" 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></html>