论坛首页 Web前端技术论坛

jquery easyui 在初始加载时,页面显示比较慢时为什么会把新增页面的表格及控件都显示出来,如何隐藏

浏览 7373 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2011-08-17  
jquery easyui 在初始加载时,为什么会把新增页面的表格及控件都显示出来了,等加载完成后就没了,怎么把加载时的新增页面里的所有内给隐藏掉

引用

<body>
        <div style="margin-bottom:5px;height:30px;line-height:30px; background:#eee;padding:5px;border: 1px solid #ccc;">
        <table id="queryTable">
            <tr>
                <td></td>
                <td>                       
                </td>
                <td>&nbsp;&nbsp;&nbsp;&nbsp;名称:</td>
                <td>
                <input id="book_name" name="book_name" type="text" style="width:200px;" height="18" maxlength="20" class="input_txt">           
                </td>
                <td></td>
                <td>

                </td>               
                <td>&nbsp;&nbsp;<input type="button" value="查询" onClick="fnQuery();"></td>               
            </tr>
        </table>
        </div>
        <table id="aSubjectList" width="750px" height="500px"></table>   
        <!--在加载时,页面显示比较慢时,先把下面的代码给显示了,怎么隐藏掉-->        <div id="eidtASubjectWindow" class="easyui-window" iconCls="icon-search"
            style="width: 800px; height: 450px; padding: 5px; background: #fafafa; ">
            <div class="easyui-layout" fit="true">
                <div region="center" border="false"
                    style="padding: 10px; background: #fff; border: 1px solid #ccc;">   
                  <s:form method="post" id="aSubjectForm">
                      <input type="hidden" name="param.book_id" id="book_id">                                     
                    <table width="100%" border="0" cellspacing="0">
                        <tr height="25">
                        <td  width="13%" height="27"  align="right">名称:</td>
                        <td width="20%"><nobr>
                            <input type="text" name="param.book_name" id="book_name" style="width:150px" class="input_txt">
                            <span style="color:red">*</span></nobr>                        </td>
                        </tr>
                        <tr height="25">
                        <td  width="13%" height="27"  align="right">书号:</td>
                        <td width="20%"><nobr>
                            <input type="text" name="param.book_sh" id="book_sh" style="width:150px" class="input_txt">
                            </nobr>                        </td>
                        </tr>
                        <tr height="25">
                        <td  width="13%" height="27"  align="right">作者:</td>
                        <td width="20%"><nobr>
                            <input type="text" name="param.book_zz" id="book_zz" style="width:150px" class="input_txt">
                            </nobr>                        </td>
                        </tr>
                        <tr height="25">
                        <td  width="13%" height="27"  align="right">出版社:</td>
                        <td width="20%"><nobr>
                            <input type="text" name="param.book_cbs" id="book_cbs" style="width:150px" class="input_txt">
                            </nobr>                        </td>
                        </tr>   
                        <tr>
                          <td height="27"  align="right">课程:</td>
                          <td >
                           <s:select  name="param.book_xl_courses_id" list="#request.coursexlList" cssStyle="width:150px" 
                                id="book_xl_courses_id" listKey="xl_courses_id" listValue="xl_courses_name" headerKey="" headerValue="请选择" />                                     
                            <span style="color:red">*</span>                         
                          </td>
                      </tr>   
                        <tr>                       
                        <td  width="15%" height="27"  align="right">费:</td>
                        <td ><nobr>
                            <input type="text" name="param.book_money" id="book_money" style="width:150px" class="input_txt">
                            <span style="color:red">*</span></nobr>                        </td>
                        </tr>
                                                                                                                                         
                        <tr>                       
                        <td  width="15%" height="27"  align="right">描述:</td>
                        <td ><nobr>
                            <input type="text" name="param.book_memo" id="book_memo" style="width:150px" class="input_txt">
                            </nobr>                        </td>
                        </tr>
                        <tr>                       
                        <td  width="15%" height="27"  align="right"> 是否停用:</td>
                        <td ><nobr>
                            <input type="checkbox" name="param.book_del" id="book_del" value="1" />
                           
                            </nobr></td>
                        </tr>
                   </table> 
                  </s:form>                            
                </div>
                <div region="south" border="false"
                    style="text-align: right; height: 30px; line-height: 30px;">
                    <span id="noshow">
                    <a class="easyui-linkbutton" iconCls="icon-ok"
                        href="javascript:void(0)" onClick="saveCategory();">确定</a>
                    <a class="easyui-linkbutton" iconCls="icon-cancel"
                        href="javascript:void(0)" onClick="closeEditWindow();">关闭</a></span>
                </div>
            </div>
        </div>     
    </body>



   发表时间:2011-08-18   最后修改:2011-08-18

可以将窗口内容用href连接引用,这样在显示窗口时再动态加载内容。

<div id="eidtASubjectWindow" class="easyui-window" iconCls="icon-search"

            href="..."
            style="width: 800px; height: 450px; padding: 5px; background: #fafafa; "></div>

 

也可以将页面全部或某部分设为不可见,再在组件解释完毕时将其重新设为可见。如

<head>

    <script>
        $.parser.onComplete = function(){
            $('#eidtASubjectWindow').css('visibility','visible');
        }
   </script>

</head>

<div id="eidtASubjectWindow" class="easyui-window" iconCls="icon-search"
            style="visibility:hidden; width: 800px; height: 450px; padding: 5px; background: #fafafa; ">

 

可以参考http://www.iteye.com/topic/1112205的用法。

0 请登录后投票
   发表时间:2011-08-18  
先试下效果,看看结果如何
0 请登录后投票
   发表时间:2011-08-18  
可以将窗口内容用href连接引用,这样在显示窗口时再动态加载内容。

<div id="eidtASubjectWindow" class="easyui-window" iconCls="icon-search"

            href="..."
            style="width: 800px; height: 450px; padding: 5px; background: #fafafa; "></div>



这个怎么做法,怎么动态加载
0 请登录后投票
   发表时间:2011-08-20  
那位还有其它方法,~~
0 请登录后投票
   发表时间:2011-08-22  
     <!--在加载时,页面显示比较慢时,先把下面的代码给显示了,怎么隐藏掉-->        <div id="eidtASubjectWindow" class="easyui-window" iconCls="icon-search"
            style="width: 800px; height: 450px; padding: 5px; background: #fafafa; ">
<script>$("#eidtASubjectWindow").hide();</script>

----------

试下把隐藏的脚本放按上面一样,放在需要隐藏的DIV后面。。要紧跟。。。
0 请登录后投票
   发表时间:2011-08-22   最后修改:2011-08-22
放在另一个div中,该div并disaplay:none
目前这是我找到的最好最简单的办法
0 请登录后投票
   发表时间:2011-08-23  
最好的办法是先定义div,在需要加载时再动态指定href属性,这样可以实现真正的动态加载,减少初如加载的内容
0 请登录后投票
   发表时间:2011-08-23  
弄个实例出来,学习一下
0 请登录后投票
   发表时间:2011-08-23  
使用visibility: hidden;
0 请登录后投票
论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics