我有一个设置,如下所示:
<div id="nav">
<div id="innernav">
//With dynamic content here.
</div>
</div>
我正在运行一个大小合适的脚本
α-NaV
到浏览器窗口的高度。但有时我的动态内容比窗口的高度还要高。有什么办法可以让我在
内中子
超过
α-NaV
那个
α-NaV
尺寸会增加吗?
就像有人要剧本一样:
function resizeWindow(){var a=getWindowHeight();document.getElementById("content").style.height=(a-0)+"px";document.getElementById("nav").style.height=(a-0)+"px";document.getElementById("contentPanel").style.height=(a-10)+"px"}function getWindowHeight(){var a=0;if(typeof(window.innerHeight)=="number"){a=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){a=document.body.clientHeight}}}return a};
更改了脚本以引用最小高度在Firefox中工作得很好。但不是IE或Chrome。
CSS:
body {
margin: 0px;
text-align: left;
font-family: Verdana;
font-size: 11px;
background-color: #FFFFFF;
min-width: 980px;
min-height: 10px;
background-image: url('../Images/watermark.png');
background-position: 100% 100%;
background-repeat: no-repeat;
}
.nav {
width: 19%;
margin: 0px 0px 0px 0px;
background-color: #E0EFFF;
float: left;
vertical-align: bottom;
position: relative;
}
对我的脚本/使用最小高度的一些细微更改似乎有效。在运行了一个cclean之后,我想做什么就做什么。