1. 程式人生 > >獲取瀏覽器視窗的高度並賦值給div

獲取瀏覽器視窗的高度並賦值給div

if (window.innerHeight){
            winHeight = window.innerHeight;
        }else if ((document.body) && (document.body.clientHeight)){
            winHeight = document.body.clientHeight-50+"px";
        }
        document.getElementById("listiframe").style.height=winHeight"px";
        document.getElementById("deptTree").style.height=winHeight+"px";