我想要的效果是几个框正好铺满整个屏幕,不论17,19还是22寸的屏,这就需要js脚本来实现,可是有些
框里并没有内容,要设置height=100%时,反而会缩的很小,我现在只能固定高度,想通过JS求h1的高度,
h2的高度是固定的,然后h3=h4=h1-h2-top-bottom,可现在的问题是没法获取h1的高度值,availHeight,
scrollHeight,clientHeight,的我都试过了,我自己写的一段JS代码如下:
    <script type="text/javascript">
    <!--//iframe自适应加载的页面高度
    function iframeAutoFit()
    {
        var ex;
        try
        {
            if(window!=parent)
            {
                var a = parent.document.getElementsByTagName("IFRAME");
                for(var i=0; i<a.length; i++) //author:meizz
                {
                    if(a[i].contentWindow==window)
                    {
                        var win =document.parentNode || document; //top.document || 
                        var h1=0, h2=0, h3=0, h4=0;
                        if(document.documentElement&&document.documentElement.scrollHeight&&document.documentElement.scrollWidth)
                        {
                            h1 = win.documentElement.scrollHeight;
                            h3 = win.documentElement.scrollWidth;
                        }
                        if(document.body) 
                        {
                         h2= win.body.scrollHeight;
                          h4=win.body.scrollWidth;                        }
                                                var h=Math.max(h1, h2);
                        var h0=Math.max(h3,h4);
                       
                        a[i].style.height = h +"px";
                        a[i].style.width = h0 + "px";
                    }
                }
            }
        }
        catch (ex){}
    }
    
    if(document.attachEvent)
    {
        window.attachEvent("onload",  iframeAutoFit);
        window.attachEvent("onresize",  iframeAutoFit);
    }
    else
    {
        window.addEventListener('load',  iframeAutoFit,  false);
        window.addEventListener('resize',  iframeAutoFit,  false);
    }
    //-->
    </script>    <script language="javascript" type="text/javascript">        function resizewin() {
            if (document.getElementById("td_l").style.display == '') {
                document.getElementById("td_l").style.display = 'none';
                document.getElementById("td_r").style.width = '75%';
                document.getElementById("imgsmall").style.display = "";
                document.getElementById("imgbig").style.display = "none";
            }
            else {
                document.getElementById("td_l").style.display = '';
                document.getElementById("td_r").style.width = '25%';
                document.getElementById("imgsmall").style.display = "none";
                document.getElementById("imgbig").style.display = "";
            }
        }
        //     function TL()
        //  {
        //     top.frames['middleFrame'].document.getElementById("switchPoint").innerText = 4;
        //     top.frames['middleFrame'].document.getElementById("switchPoint").title="显示目录树";
        //     top.mainframeset.cols = "1,8,*";
        //  }
    </script>