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

问题描述

页面只显示一半,谁能给我解答一下
<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你马虎了一下,你填完整试一下

时间: 2024-11-03 19:49:54

px-页面只显示一半,谁能给我解答一下的相关文章

页面只显示“This is my JSP page.”

问题描述 一个java源代码项目部署完了,运行时候http://admin-ba60fb229:8080/Pethospital/页面只显示"ThisismyJSPpage."什么都没有,这什么原因呀?数据库连接的配置文件也改好了的,这个是需要从哪几个地方改的呀?坐等大师解决.... 解决方案 解决方案二:这个是欢迎页吧.没有内容,你找找文件.解决方案三:贴上你页面的代码看看解决方案四:http://admin-ba60fb229:8080/Pethospital/这个默认到你web.

怎么单面内存只显示一半容量

  电脑以前用的是xxxMB的内存,后增加内存就换了条256MB的内存,但是在开机以后显示的还是xxxMB,怎么办?以下是问题原因与解决办法:一般出现这样的原因不一定非是内存坏损,这也可能是因内存条是单面内存导致.现在有的主板不支持单面内存,从而就会出现只能检测内存一半的内存容量.此时可把单面的换成双面256B内存,或者是用两条128MB内存插上.

手机端提交照片,后台能看到照片但只显示一半是什么原因?

问题描述 byte[]bytes=Convert.FromBase64String(strPhoto);然后把bytes显示为图片时,图片有一半显示灰色Response.ContentType="image/gif";Response.BinaryWrite(bytes); 解决方案 解决方案二:后台最终收到的图片有损坏解决方案三:手机端在提交的时候会不会因为网络原因丢包或者什么..解决方案四:应该是丢包,但不知道怎么解决.打开手机端数据库看了下照片是好的,然后手机端的照片转为字符串和

简单百宝箱为什么工具界面只显示一半

这是由于您调整了显示器的设置引起的.建议您按照以下流程进行操作. 右键点击桌面→选择"属性"→选择"设置"→点击"高级"→选择"常规" 在显示的窗口内查看DPI设置,选择"正常尺寸(96 DPI)"

xp桌面图标只显示一半另一半显示其他程序图标如何解决

  步骤如下: 1.点击"开始"-"运行",在框中输入"regedit"点击确定打开注册表; 2.在注册表左侧展开:HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Explorer/Shell Folders/Desktop; 3.在右侧双击打开"Common Desktop",将其数值数据修改为"%ALLUSERSPROFILE%"

EXT grid只显示一条数据;

问题描述 / 定义Proxyvar proxy = new Ext.data.HttpProxy({url : "plantsAction!getPlantsById.action"});var Order = Ext.data.Record.create([{name : "cabinetName",type : "string",mapping : "cabinetName"}, {name : "cabinet

XtraReport打印预览只显示一行记录

问题描述 DevExpress是12.1.4的版本,打印预览代码如下:stringdir=Directory.GetCurrentDirectory()+@"Reports"+frmName+".repx";if(File.Exists(dir)){DevExpress.XtraReports.UI.XtraReportreport=newDevExpress.XtraReports.UI.XtraReport();report.LoadLayout(dir);re

为什么只显示一条FLASH 记录呢!

问题描述 前台:<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml

html表格table的宽度超出页面宽度时如何不改变table宽度(只显示出滚动条)?

问题描述 html表格table的宽度超出页面宽度时如何不改变table宽度(只显示出滚动条)? 问题如题.条件是不能将table的宽度设置为固定值,因为table包含的列数可能每次查询都不同,可能只有一二列,也可能有几十列,要求每一列宽度能够显示其表格的内容(即列的宽度按内容长度显示),如果table宽度没有超出页面宽度就不显示滚动条,也不拉伸表列宽度:如果table宽度超出页面宽度,就显示滚动条,而不压缩表列宽度. 解决方案 http://blog.sina.com.cn/s/blog_66