模态不褪色

时间:2013-04-08 05:36:31

标签: javascript modalpopupextender

这是我用来获取模态的淡化效果的javascript ...它不起作用。我不知道为什么。它就像闪光灯一样弹出。我想让它慢慢消失。然后在关闭时淡出。

     <link href="Styles/myStyleSheet.css" rel="stylesheet" type="text/css" />
 <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
 <link href="Styles/Tab.css" rel="stylesheet" type="text/css" />

 <script type="text/javascript" language="javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
 <script type="text/javascript" language="javascript" src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>

var launch = false;
function launchModalV2() {
    launch = true;
}

function pageLoad() {
    if (launch) {
        //alert('1');
        // $find("mpeTest").show();
        $find('mpeTest').fadeIn();
    }
}

function launchModalV1() {
    alert('1');
    //$find('mpeTest').show();
    $find('mpeTest').fadeIn();
    return false;
}

CSS类:

.modalBackground
{
background-color: Black;
-filter: alpha(opacity=80);
-opacity: 0.6;
z-index: 10000;
}


<div style="position:absolute">
<act:ModalPopupExtender ID="mpeTest" BehaviorID="mpeTest" runat="server" TargetControlID="btnShowModal" PopupControlID="pnlPopup" OkControlID="btnOk" BackgroundCssClass="modalBackground">
</act:ModalPopupExtender>  
<asp:Button ID="btnOk" runat="server" Text="Ok" />
</div>

 <div>
    <asp:UpdatePanel runat="server" ID="pnlPopup">
    <ContentTemplate>
    <asp:Panel ID="pnlMyAddressBook" runat="server" BackColor="White" CssClass="roundcorner pnl">

    <table style="width:100%" cellspacing="0px" cellpadding="0px">..........

1 个答案:

答案 0 :(得分:0)

尽管使用$("#mpeTest").modal("show")

,您仍可以尝试使用$find('mpeTest').fadeIn();