如何在Modal Pop中设置不透明度? [英] How to set opacity in Modal Pop?

查看:135
本文介绍了如何在Modal Pop中设置不透明度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的ModalPopUp代码是

 <   ajaxToolkit :ModalPopupExtender     ID   =  ModalPopUp    runat   =  server    BackgroundCssClass   =  modalBackground  

CancelControlID = CancelButton DropShadow = true 已启用 = true < span class =code-attribute> PopupControlID = Panel1

TargetControlID = btn >
< / ajaxToolkit:ModalPopupExtender >





&在Panel One文本框中有2个按钮&我在Page load事件中调用了它。



我的css文件是:

 modalBackground  
{
background-color 灰色;
过滤器 alpha(opacity = 70);
opacity 0.7;
}

modalPopup
{
background-color #ffffdd;
border-width 3px;
border-style solid;
border-color 灰色;
padding 3px;
width 250px;
}





但是当触发ModalPopUp时,不透明度和bgcolor不起作用(modalBackground:css类文件没有触发)



帮我解决。



我试图在Chrome和Firefox中查看此内容。它不起作用。

解决方案





尝试重写css类,如下所示风格是否适用。

 modalBackground  
{
< span class =code-attribute> background-color 灰色;
过滤器 alpha(opacity = 70);
- moz-opacity 0.7 ;
不透明度 0.7 ;
}





因为,属性不透明度无法在Mozilla中识别,所以你必须写成 -moz-opacity



希望它有效。

您好,我已经在我的测试页解决方案中检查了您的代码并且工作正常。可以检查你的css文件是否与页面正确连接(或者你可以在firebug或开发者控制台中检查css是否已加载)。


my ModalPopUp code is

<ajaxToolkit:ModalPopupExtender ID="ModalPopUp" runat="server" BackgroundCssClass="modalBackground"

                    CancelControlID="CancelButton" DropShadow="true" Enabled="true" PopupControlID="Panel1"

                    TargetControlID="btn">
                </ajaxToolkit:ModalPopupExtender>



& In Panel One Text Box with 2 Buttons & i called this in Page load event.

my css file is:

.modalBackground
{
    background-color: Gray;
    filter: alpha(opacity=70);
    opacity: 0.7;
}

.modalPopup
{
    background-color: #ffffdd;
    border-width: 3px;
    border-style: solid;
    border-color: Gray;
    padding: 3px;
    width: 250px;
}



But while triggering ModalPopUp, opacity and bgcolor is not working(modalBackground:css class file is not triggering)

Help me to solve.

I was trying to view this in Chrome and Firefox. it is not working.

解决方案

Hi,

try by rewriting the css class as below and check whether the style is applying or not.

.modalBackground
{
    background-color: Gray;
    filter: alpha(opacity=70);
    -moz-opacity: 0.7;
    opacity: 0.7;
}



because, property opacity will not recognize in Mozilla, so you have to write as -moz-opacity.

hope it works.


Hi I have check your code in my test page solution and its work fine. May be check if your css file is properly attached with page(or u can check in firebug or developer console that css is attached loaded or not).


这篇关于如何在Modal Pop中设置不透明度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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