2016-08-04 205 views
0

我在jQuery對話框中關閉按鈕有問題。不知怎的,該按鈕的標題沒有隱藏,並在圖標pic上疊加。jquery對話框關閉按鈕標題疊加關閉圖標

我檢查的元素,這是我得到pic

是什麼在_Layout.cshtml呈現

<head> 
    <link href="/Content/Site.css" rel="stylesheet"/> 
    <link href="/Content/datepicker.css" rel="stylesheet"/> 
    <link href="/Content/AboutContactUs.css" rel="stylesheet"/> 
    <link href="/Content/userPage.css" rel="stylesheet"/> 
    <link href="/Content/home.css" rel="stylesheet"/> 
    <link href="/Content/themes/base/core.css" rel="stylesheet"/> 
    <link href="/Content/themes/base/resizable.css" rel="stylesheet"/> 
    <link href="/Content/themes/base/selectable.css" rel="stylesheet"/> 
    <link href="/Content/themes/base/accordion.css" rel="stylesheet"/> 
    <link href="/Content/themes/base/autocomplete.css" rel="stylesheet"/> 
    <link href="/Content/themes/base/button.css" rel="stylesheet"/> 
    <link href="/Content/themes/base/dialog.css" rel="stylesheet"/> 
    <link href="/Content/themes/base/slider.css" rel="stylesheet"/> 
    <link href="/Content/themes/base/tabs.css" rel="stylesheet"/> 
    <link href="/Content/themes/base/progressbar.css" rel="stylesheet"/> 
    <link href="/Content/themes/base/theme.css" rel="stylesheet"/> 
</head> 
<body> 
    .... 
    <script src="/Scripts/jquery-3.1.0.js"></script> 
    <script src="/Scripts/ajax-popup.js"></script> 
    <script src="/Scripts/moment.js"></script> 
    <script src="/Scripts/bootstrap.js"></script> 
    <script src="/Scripts/bootstrap-datepicker.js"></script> 
    <script src="/Scripts/bootstrap-datetimepicker.js"></script> 
    <script src="/Scripts/respond.js"></script> 
    <script src="/Scripts/jquery-ui-1.12.0.js"></script> 
</body> 

下面是如何設置的對話框:

$(document).ready(function (e) { 
    .... 
    $("#addSuccessDialog").dialog({ 
     height: 100, 
     width: 200, 
     autoOpen: false, 
     modal: true 
    }); 
    var popupDialog = function (e) { 
     $("#addSuccessDialog").dialog("open"); 
    } 

    // the return viewed has many add buttons, each button is registered with the handler above. 
    $("#giftSearchButton").click(function (e) { 
     $("#ajaxLoader").show(); 
     $.ajax({ 
      url: 'testAmazon', 
      type: 'POST', 
      data: JSON.stringify({ cat: $("#EventGiftViewModal_selectedCategory").val(), kw: $("#EventGiftViewModal_keyWord").val(), tabContentWidth: tabContentWidth }), 
      contentType: 'application/json; charset=utf-8', 
      success: function (e) { 
       $("#ajaxLoader").hide(); 
       $("#giftSearchResult").empty(); 
       $("#giftSearchResult").html(e); 
       $(".addGift-primary").each(function() { 
        $(this).click(popupDialog); 
       }) 
      } 
     }); 
    }); 
    .... 
}); 
+0

我無法複製結果。在這裏測試:https://jsfiddle.net/Twisty/r2a6d3kp/很高興你找到了解決方案。 – Twisty

回答