请大家帮忙,我想通过通过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>
"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>
解决方案 »
- 在非IE浏览器中,带下滑线的变量如何访问
- 为什么提示是“string”类型?
- 高手进来看看document.cookie与Set-Cookie的区别?
- wml 与 php 的问题,请高手帮忙,在线等待。
- 如何读取XML
- 第三方的div确认提示框为什么不能代替window.confirm()
- 把extjs4.2 desktop 窗口最大化动画效果移植到extjs4.1 中
- 关于正则表达式问题!!!在线等!!!
- 怎么做一个跟随鼠标的可设定的时间倒计时显示。帮帮我~~~~~~~~~~~~~~~~
- javascript和jsp是否可以兼容
- 有一问题不解?Jquery 的get。传递参数,字符串长度有限制吗?
- 如何用jquery判断文件域 是否为空?
"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>
得放在body标签里,你直接用我的~·看看跟你哪写的不一样
var topDocument = window.parent.document,
el = topDocument.getElementById("frameId"),
height = topDocument.body.clientHeight;
el.setAttribute("rows","126," + (height - 126) + ",90");