页面只显示一半,谁能给我解答一下

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="../css/windowscss.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery.js" type="text/javascript"></script>
    <%--<style type="text/css">
            * {
                margin: 0;
                padding: 0;
            }
            #main {
                height: 500px;
                margin-top: 10px;
                width: 100%;
            }
            #main li {
                float: left;
                list-style: none outside none;
            }
            #main > li {
                width: 100%;
            }
            #main ul {
                height: 26px;
                margin-left: 5px;
            }
            .pageLI {
                background-color: #99FFFF;
                height: 20px;
                margin-left: 1px;
                margin-right: 1px;
                padding-bottom: 4px;
                padding-top: 4px;
            }
            .pageLI a {
                margin: 10px 13px;
                text-decoration:none;
            }

            .pageLI:hover {
                background-color:#FFCCFF;
            }

         </style>--%>

    <script>
        $(function () {
            $("#main ul li a").click(function () {
                $("#main ul li").removeClass("selected");
                $(this).parent().addClass("selected");
            });
        });

        function SetCwinHeight(obj, bl) {
            try {
                var cwin = obj;
                if (parseInt($(cwin).attr("contentWindow").document.body.scrollHeight) > parseInt($(cwin).attr("iht")) && bl == "true") {
                    cwin.height = $(cwin).attr("contentWindow").document.body.scrollHeight + 50;
                }
                else {
                    cwin.height = $(cwin).attr("iht");
                }

                //按屏幕适应宽度
                if ((document.body.scrollWidth - 259) > parseInt($(cwin).attr("ith")) && bl == "true") {
                    cwin.width = document.body.scrollWidth - 259;
                }
                else {
                    cwin.width = $(cwin).attr("ith");
                }
            }
            catch (ex) {
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:HiddenField ID="hidParentID" runat="server" />
        <ul id="main">
            <li>
                <ul runat="server" id="pageLIs">
                    <li class="pageLI selected">
                        <a href="TC_TerminalDetail.aspx" target="frmMain">客运站明细</a>
                    </li>
                    <li class="pageLI">
                        <a href="TC_TerminalTime.aspx" target="frmMain">列车时刻列表</a>
                    </li>
                     <li class="pageLI">
                        <a href="TC_BusList.aspx" target="frmMain">监控列表</a>
                    </li>
                </ul>
            </li>
            <li style="height: 500px; width: 100%; border:solid 1px #047bcb;">
                <iframe id="frmMain" name="frmMain" frameborder="0" scrolling="auto" width="99%" src='<% =string.Format("TC_TerminalDetail.aspx?ID={0}"+(!string.IsNullOrEmpty(Request["HrefType"]) ? "&HrefType=1" : ""),ViewState["ID"]) %>' iht="490" onload="Javascript:SetCwinHeight(this,'true')"></iframe>
            </li>
        </ul>
    </form>
</body>
</html>

页面运行的效果如图:图片说明
请问只显示了一小半,这是怎么回事?

高度获取有问题。你的tab的链接到的页面是不是加了xhtml申明了?是的话你应该使用documentElement属性。而且你iframe的自定属性iht="490",你代码里面有些写成了ith。。

改成下面这样试试

    function SetCwinHeight(obj, bl) {
        try {
            var doc = obj.contentWindow.document;
            var scrollHeight = Math.max(doc.body.scrollHeight, doc.documentElement.scrollHeight); //取最大值,可以忽略xhtml的申明
            var iht = parseInt(obj.getAttribute('iht'));
            if (scrollHeight > iht && bl == "true") {
                obj.height = scrollHeight + 50;
            }
            else {
                obj.height = iht;
            }
            var scrollWidth = Math.max(doc.body.scrollWidth, doc.documentElement.scrollWidth);
            //按屏幕适应宽度
            if ((scrollWidth - 259) > iht && bl == "true") {
                obj.height = scrollWidth - 259;
            }
            else {
                obj.height = iht;
            }
        }
        catch (ex) {
        }
    }

你把ul的高度为26px,调的稍微大点试试吧

哦哦哦。刚才图片加载慢,不是那得原因,iframe的height你马虎了一下,你填完整试一下