在处理和显示动画gif时锁定页面的问题 [英] Problem in locking a page while processing and showing an animated gif

查看:65
本文介绍了在处理和显示动画gif时锁定页面的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我试图通过灰屏来锁定页面,同时通过css文件,UpdatePanel和UpdateProgress控件进行长时间处理。我也展示了一个GIF动画。除了进度图像不是实体外观(不透明度不是100)之外,它工作正常。似乎进度图像的不透明度是从其父div的css(灰显)继承的。我尝试了几件事,但我没有运气。有什么我的代码丢失,或者有其他方法来实现这个吗?



如果我在.overlay css文件中使用rgba作为背景(注释在代码),进度图像变为纯色,但由于某种原因,即使页面变灰,页面也不再被锁定。 (所有控件都变为活动状态。)



我的代码出了什么问题?

提前致谢。



 overlay  {
background-颜色 #808080;
过滤器 alpha(opacity = 70);
opacity 0.7;
moz-opacity 0.7;
khtml-opacity .7;
/ * background:rgba(128,128,128,0.5 );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr =#7f808080,endColorstr =#7f808080); * /

position 绝对;
z-index 99;
top 0px;
left 0px;
width 100%;
height 100%;
}
modalprogress
{
z-index 200;
background-color #ffffff;
position 绝对值;
top 50%;
left 50%;
margin -11px 0 0 - 125像素;
颜色 黑色;
font large;
font-family Arial;
text-align center;
}
theprogress {
background-color #ffffff;
width 300px;
height 50px;
text-align center;
border-style solid;
border-color 黑色;
border-width < span class =code-keyword>:
1pt;
}





 <   asp:UpdatePanel  < span class =code-attribute>   ID   =  UpdatePanel1    runat   =   server    UpdateMode   = 始终 >  
< span class =code-keyword>< ContentTemplate >
< 表格 >
< tr >
< td align = right >
< asp:按钮 ID = btnCommit runat = server < span class =code-attribute>文本 = 提交更改 高度 = 30px 宽度 = 115px 字体大小 = XX-Small

/ >
< / td >
< / tr >
< / table >
< / ContentTemplate >
< / asp:UpdatePanel >
< < span class =code-leadattribute> asp:UpdateProgress ID = UpdateProgress1 runat = server < span class =code-attribute> AssociatedUpdatePanelID = UpdatePanel1

DisplayAfter = 0 DynamicLayout = true >
< ProgressTemplate >
< div class = overlay >
< div class = < span class =code-keyword> modalprogress >
< div class = theprogress >
< width = 100% cellpadding = 10px >
< tr >
< td >
< img id = Img2 src = ../。 ./Images/PleaseWaitBall.gif\" runat = server alt = 请稍候 < span class =code-keyword> / >
< / td >
< td >
< asp:标签 ID < span class =code-keyword> = lblProcess ing runat = server 文本 = 处理请求。请等待...... > < / asp:标签 >
< / td >
< < span class =code-leadattribute> td >
< img id = Img1 src = ../../ Images / PleaseWaitBall.gif runat = server alt = 请稍候 / >
< / td >
< / tr >
< / table >
< / div >
< / div >
< / div >
< / ProgressTemplate >
< / asp:UpdateProgress >

解决方案





我发现了一个非常简单的解决方案。我只需要让第一个div独立于其他2个div,这样第2和第3个div就不会继承第一个div的css。



 <   asp:UpdateProgress     ID   =  UpdateProgress1    runat   = 服务器    AssociatedUpdatePanelID   =   UpdatePanel1  

DisplayAfter = 0 DynamicLayout = < span class =code-keyword> true >
< ProgressTemplate >
< div class = overlay >
< / div >
< div class = moda lprogress >
< div class = theprogress >
< width = 100% cellpadding = 10px >
< tr >
< td >
< img id = Img2 src = ../../ Images / PleaseWaitBall.gif runat = server alt = < span class =code-keyword>请稍候 / >
< / td >
< td >
< asp:标签 ID = lblProcessing runat = server 文本 = 处理请求。请等待...... > < / asp:标签 >
< / td >
< < span class =code-leadattribute> td >
< img id = Img1 src = ../../ Images / PleaseWaitBall.gif runat = server alt = 请稍候 / >
< / td >
< / tr >
< / table >
< / div >
< / div >
< / ProgressTemplate >
< / asp:UpdateProgress >


Hi,

I am trying to lock a page by graying it out while a long processing post back by css files, UpdatePanel, and UpdateProgress controls. Also I show a animated gif. It works fine except that the progress image is not solid appearance (opacity is not 100). It seems that the opacity for the progress image is inherited from its parent div's css (graying out). I tried several things but I have no luck. Is there anything my code missing, or is there another way to achieve this?

If I use rgba for the background in the .overlay css file (commented out in the code), the progress image becomes solid color, but for some reason the page is no longer locked out even though the page is grayed out. (All the controls become active.)

What is wrong with my code?
Thanks in advance.

.overlay {
       background-color: #808080;
       filter: alpha(opacity=70);
       opacity: 0.7;
       moz-opacity: 0.7;
       khtml-opacity: .7;
       /*background: rgba(128, 128, 128, 0.5);
       filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f808080, endColorstr=#7f808080);*/
       position: absolute;
       z-index: 99;
       top: 0px;
       left: 0px;
       width: 100%;
       height: 100%;
   }
   .modalprogress
   {
       z-index: 200;
       background-color: #ffffff;
       position: absolute;
       top: 50%;
       left: 50%;
       margin: -11px 0 0 -125px;
       color: black;
       font: large;
       font-family: Arial;
       text-align:center;
   }
   .theprogress {
       background-color: #ffffff;
       width: 300px;
       height: 50px;
       text-align: center;
       border-style:solid;
       border-color:Black;
       border-width:1pt;
   }



<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
<ContentTemplate>
    <table>
    <tr>
    <td align="right">
        <asp:Button ID="btnCommit" runat="server" Text="Commit Changes" Height="30px" Width="115px" Font-Size="XX-Small"

        />
    </td>
    </tr>
    </table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"

DisplayAfter="0" DynamicLayout ="true">
    <ProgressTemplate>
    <div class="overlay">
    <div class="modalprogress">
    <div class="theprogress">
        <table width="100%" cellpadding="10px">
            <tr>
                <td>
                    <img id="Img2" src="../../Images/PleaseWaitBall.gif" runat="server" alt="Please wait" />
                </td>
                <td>
                    <asp:Label ID="lblProcessing" runat="server" Text="Processing Request.  Please, wait..."></asp:Label>
                </td>
                <td>
                    <img id="Img1" src="../../Images/PleaseWaitBall.gif" runat="server" alt="Please wait" />
                </td>
            </tr>
        </table>
    </div>
    </div>
    </div>
    </ProgressTemplate>
</asp:UpdateProgress>

解决方案

Hi,

I found a really simple solution for this issue. I just needed to have the first div independent from the other 2 divs, so that the 2nd and 3rd div do not inherit the first div's css.

<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"

DisplayAfter="0" DynamicLayout ="true">
    <ProgressTemplate>
    <div class="overlay">
    </div>
    <div class="modalprogress">
    <div class="theprogress">
        <table width="100%" cellpadding="10px">
            <tr>
                <td>
                    <img id="Img2" src="../../Images/PleaseWaitBall.gif" runat="server" alt="Please wait" />
                </td>
                <td>
                    <asp:Label ID="lblProcessing" runat="server" Text="Processing Request.  Please, wait..."></asp:Label>
                </td>
                <td>
                    <img id="Img1" src="../../Images/PleaseWaitBall.gif" runat="server" alt="Please wait" />
                </td>
            </tr>
        </table>
    </div>
    </div>
    </ProgressTemplate>
</asp:UpdateProgress>


这篇关于在处理和显示动画gif时锁定页面的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆