javascript - Angular 2 ng-bootstrap 开启多个模型

标签 javascript angularjs twitter-bootstrap ng-bootstrap

我正在尝试使用 ng-bootstrap 在另一个模型之上打开模式。模型按预期打开,但第二个模型的模态背景位于第一个模型后面。 enter image description here

模型已打开为 document 。没有做什么特别的事情。

最佳答案

我只需添加以下 css 代码就可以完成这项工作。

.modal:nth-of-type(2) {
    z-index: 1051 !important;
}
.modal-backdrop:nth-of-type(2) {
    z-index: 1050 !important;
}

.modal:nth-of-type(3) {
    z-index: 1052 !important;
}
.modal-backdrop:nth-of-type(3) {
    z-index: 1051 !important;
} 

我想打开 3 个嵌套模型。这就是为什么我添加了 nth-of-type(2) 和 nth-of-type(3)

关于javascript - Angular 2 ng-bootstrap 开启多个模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45974138/

相关文章:

javascript - 检查 window.history.go 是否成功?

javascript - 使用 pg-promise 执行接受参数数组的 Postgresql 函数

angularjs - ngRepeat 中的 $first

javascript - Bootstrap - 通过 JavaScript 警报事件防止警报关闭

java - 使用 DXL 导出器将 javascript 脚本库导出到使用 Java 的文件

javascript - 如何将 Soundcloud API(身份验证)与 Angular.js 一起使用

javascript - Angularjs - 使用 ng-repeat 连续多次循环

jquery - 禁用 Bootstrap 日期选择器中的月份

forms - Twitter Bootstrap 表单 : Make label column wider

javascript - 'Sys' 未定义 - Ajax - master 和 contentpages ASP.NET 4.0