我的页面是个框架集,分为左(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写,怎么写呀。而且有好多这样的页面是这样。
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写,怎么写呀。而且有好多这样的页面是这样。
解决方案 »
- js问题
- javascript在firefox,IE下的兼容写法
- 清空上传文件框后,不能提交表单了
- JavaScript怎样写网页上的验证码代码?
- ·Document.GetElementByld(?,?)是什么意思?
- 【我的世界难题】js写条cookie,其中有两个属性,结果两种方法只有一种遂愿,求解???
- 怎样获取、设置textarea光标位置,且兼容ie?
- 怎么样让ie中嵌入的meida player有全屏按纽?
- 为什么打不开服务器上的文件(急!!!!)
- ajax访问本机上的localhost没问题,丢到服务器上就不行,127也不行,要访问ip地址,有什么解决办法!?
- 横向菜单的问题
- 请教如何调用一个网页的某个部分?
<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>
是基于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>
支持1L的
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秒里面的滚动条才跟上来。