您的位置:首页 > Web前端 > JavaScript

js—当浏览器窗口大小改变时事件

2013-09-04 11:56 381 查看
<script type="text/javascript">
window.onload=function(){
changeDivHeight();
}
//当浏览器窗口大小改变时,设置显示内容的高度
window.onresize=function(){
changeDivHeight();
}
function changeDivHeight(){
var h = document.documentElement.clientHeight;//获取页面可见高度
document.getElementById("div_ov_y").style.height=h-140+"px";
}



                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: