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

<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";  

    }

<script>

原文地址:https://www.cnblogs.com/sese/p/4759077.html