2013-04-08 47 views
0

這是我用來獲取模態的衰落效果的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">.......... 
+0

這將有助於看到HTML已經由'ModalPopupExtender',產生什麼還什麼JS庫是你使用? – plalx 2013-04-08 06:11:51

回答

0

您可以嘗試使用$("#mpeTest").modal("show")儘管使用$find('mpeTest').fadeIn();

+0

儘管含義... rt?我應該把這一行之前或之後的fadeIn()? – adityawho 2013-04-08 05:49:15

+0

我的意思是用'$(「#mpeTest」)。modal(「show」)'替換'$ find('mpeTest')。fadeIn()'。希望對你有效。 – 2013-04-08 05:50:47

+0

不工作..大概你明白了...我想它淡入...它已經顯示! – adityawho 2013-04-08 05:53:49