模态不褪色

modal not fading

本文关键字:不褪色 模态      更新时间:2023-09-26

这是我用来获得模态的衰落效果的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">..........

您可以尝试使用$("#mpeTest").modal("show"),尽管使用$find('mpeTest').fadeIn();