javascript如何根据页面大小变化来确实是否显示滚动条所占据的位置

来源:百度知道 编辑:UC知道 时间:2024/06/14 19:31:04
大家好:
我做的后台首页有三个框架。上面。左边。和右边。我想在左边框架需要的时间显示滚动条,并且在不需要的时候取消滚动条所占据的框架宽度。左边是栏目。由于有展开收缩菜单。所以页面会变换大小。。。。
其实我想达到的效果很简单.我的框架页面index.php里面有left.php.这个left.php由于有伸缩菜单所以页面原高度会发生变换.而太高则会显示滚动条.我想让他需要显示滚动条的时候index.php里面值是:<iframeset cols="180,*">没有滚动条的时候变成<iframeset cols="150,*">12345651132

<HTML>
<HEAD>
<!-- 滚动区域坐标大小定位-->
<STYLE type=text/css>
#divContainer {
CLIP: rect(0px 294px 20px 0px); HEIGHT: 20px; LEFT: 0px; OVERFLOW: hidden; POSITION: absolute; TOP: 0px; VISIBILITY: hidden; WIDTH: 294px
}
#divContent {
LEFT: 0px; POSITION: absolute; TOP: 0px
}
</STYLE>

<SCRIPT language=JavaScript>
// 滚动开始
function verifyCompatibleBrowser(){
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
return this
}
bw=new verifyCompatibleBrowser()

var speed=0

var loop, timer

function ConstructObj