js 页面高度随浏览器变化

 <script type="text/javascript">

        //自动高度

        window.onload=function(){

            changeDivHeight();

        }

        //当浏览器窗口大小改变时,设置显示内容的高度

        window.onresize=function(){

            changeDivHeight();

        }

        function changeDivHeight(){

            var h = document.documentElement.clientHeight;//获取页面可见高度

            document.getElementById("allmap").style.height = h - 60 + "px"; 

            document.getElementById("pbox").style.height = h - 60 + "px";

        }

 </script>

http://blog.csdn.net/luoyejie/article/details/11045407

你可能感兴趣的:(浏览器,自适应高度)