我使用bootbox.confirm
與ajax調用,並且我得到確認框,但我的屏幕變灰,我無法選擇任何東西。jquery bootbox屏幕灰顯
這裏是什麼樣子:
我首先想到的是,也許我的腳本在_Layout
引用錯了,但我不知道:
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
捆綁
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/moment.js",
"~/Scripts/bootstrap-datetimepicker.js",
"~/Scripts/jquery-ui.js",
"~/Scripts/Scripts.js"
);
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/bootbox.js",
"~/Scripts/respond.js"));
當檢查這裏是我有:
<body class="modal-open">
<div class="modal-backdrop fade in"></div>
<div class="modal-dialog">...</div>
這裏是我的腳本:
$(document).ready(function() {
var table = $("#Table").DataTable();
$("#Table.js-delete").on("click",
function() {
var link = $(this);
$("body").removeClass("modal-open");
bootbox.confirm("Are you sure you want to delete this?",
function (result) {
$(".modal-backdrop").remove();
if (result) {
$.ajax({
url: "/api/Informations/" + $(this).attr("data-id"),
method: "DELETE",
success: function() {
table.row(link.parents("tr")).remove().draw();
link.parents("tr").remove();
}
});
}
});
});
});
,幾乎看起來像一個z-index的東西,一切在同一時間出現並且其僅僅是出於爲了 – Keith
@Keith所以你有什麼建議? –
@Keith in bootstrap.css ..'.modal-backdrop'的類的z-index爲1040 –