没有合适的资源?快使用搜索试试~ 我知道了~
计算Web页面的高度并给div赋高度
4星 · 超过85%的资源 需积分: 43 70 下载量 199 浏览量
2012-04-06
16:33:30
上传
评论
收藏 1KB TXT 举报
温馨提示
试读
2页
计算Web页面的高度并给div赋高度,得到的是工作区的高度,根据工作区高度计算的
资源推荐
资源详情
资源评论
var height1 = window.screen.availHeight - (window.screenTop + (window.screen.height - window.screen.availHeight));
var top = document.getElementById("top").offsetHeight;
var foot = document.getElementById("foot").offsetHeight;
var list = height1 - top - foot;
document.getElementById("list").style.height = list;
window.screen.availHeight //得到工作区的高度
window.screen.height //得到分辨率的高度
window.screenTop //浏览器上面的高度
window.screen.height-window.screen.availHeight //浏览器下面的高度
<script>
var height1 = window.screen.availHeight - (window.screenTop + (window.screen.height - window.screen.availHeight));
var top = document.getElementById("top").offsetHeight;
var foot = document.getElementById("foot").offsetHeight;
var list = height1 - top - foot;
document.getElementById("list").style.height = list;
//window.screen.availHeight //得到工作区的高度
//window.screen.height //得到分辨率的高度
//window.screenTop //浏览器上面的高度
window.screen.height-window.screen.availHeight //浏览器下面的高度
</script>
<div class="main">
<div id="top">
</div>
<div id="list" class="left_page">
</div>
<div id="foot" class="footer">
var top = document.getElementById("top").offsetHeight;
var foot = document.getElementById("foot").offsetHeight;
var list = height1 - top - foot;
document.getElementById("list").style.height = list;
window.screen.availHeight //得到工作区的高度
window.screen.height //得到分辨率的高度
window.screenTop //浏览器上面的高度
window.screen.height-window.screen.availHeight //浏览器下面的高度
<script>
var height1 = window.screen.availHeight - (window.screenTop + (window.screen.height - window.screen.availHeight));
var top = document.getElementById("top").offsetHeight;
var foot = document.getElementById("foot").offsetHeight;
var list = height1 - top - foot;
document.getElementById("list").style.height = list;
//window.screen.availHeight //得到工作区的高度
//window.screen.height //得到分辨率的高度
//window.screenTop //浏览器上面的高度
window.screen.height-window.screen.availHeight //浏览器下面的高度
</script>
<div class="main">
<div id="top">
</div>
<div id="list" class="left_page">
</div>
<div id="foot" class="footer">
Oo小勇oO
- 粉丝: 1
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页