Jquery 如何在模态内部使用sweetalert2?
我正在使用最新版本的sweetalert,如何在模型内部调用sweetalert?警报显示,但它实际上被模式阻止,这是我得到的结果 它实际上被模态阻挡了,我能做些什么使它向前?谢谢大家!Jquery 如何在模态内部使用sweetalert2?,jquery,bootstrap-modal,sweetalert,sweetalert2,Jquery,Bootstrap Modal,Sweetalert,Sweetalert2,我正在使用最新版本的sweetalert,如何在模型内部调用sweetalert?警报显示,但它实际上被模式阻止,这是我得到的结果 它实际上被模态阻挡了,我能做些什么使它向前?谢谢大家! swal({ title: "Are you sure?", type: "warning", confirmButtonText:"Yes", confirmButtonColor:"#18a689", canc
swal({
title: "Are you sure?",
type: "warning",
confirmButtonText:"Yes",
confirmButtonColor:"#18a689",
cancelButtonText:"No",
showCancelButton: true,
showLoaderOnConfirm: true
}).then( function () {
$.ajax({
url: [[@{/jobDetails/remove}]],
type: "POST",
data:{jobId:id,masterId:masterListId},
success: function (result) {
if (result=="success"){
refreshJobDetails(masterListId)
reWriteMainTable();
}
},
error: function (thrownError) {
}
});
})
我相信你的问题是关于
z-index
CSS属性的
SweetAlert2的容器默认具有z-index:1060
。为了增加它,您需要在CSS样式中使用如下内容:
.swal2容器{
z-索引:{X};
}
其中,{X}
是一个大于另一个模式的z-index
的数字,例如,100000
这帮助了我:
::ng-deep.swal2-container{
z指数:1000000;
}
解决方案是使用z-index
将sweet警报模式置于顶部
.swal-overlay
{
z-index: 100000000000; !important
}
只需检查modal的
z-index
,并将.sweet overlay
z-index
属性置于modals值之上。如果有人仍然存在此问题,请尝试使用此代码段。
这解决了我的问题
:host ::ng-deep .swal2-container {
z-index: 300000 !important;}
是否存在使模型本身变灰的方法?即使z-index更精确,模型本身看起来也一样。我想把这个模型作为sweetalert的基础