gpt4 book ai didi

jquery - ColVis 选择出现在 Bootstrap Modal 后面

转载 作者:行者123 更新时间:2023-12-01 01:45:42 24 4
gpt4 key购买 nike

我遇到了与这里提出的相同的问题:

jQuery Datatables Column list rendering behind the jQuery Modal Dialog

我在 Bootstrap 模式窗口中有一个 DataTables 表,并且我尝试使用 DataTables 的 ColVis 扩展来使列可选。当我单击模式上可见的“显示列”按钮时,什么也没有出现。但是,当我关闭模式时,我发现列列表中的每列都有一个复选框,位于模式后面。

ColVis 选择面板需要在模式顶部可见,并且需要与模式一起出现和消失。

我在 ColVis.css 文件中的三个位置更改了 z-index 属性,将每个位置乘以 10 倍:

div.ColVis_collectionBackground {
background-color: black;
/*z-index: 1100;*/
z-index: 11000;
}

div.ColVis_collection {
position: relative;
width: 150px;
background-color: #f3f3f3;
padding: 3px;
border: 1px solid #ccc;
/*z-index: 1102;*/
z-index: 11020
}

div.ColVis_collection button.ColVis_Button {
background-color: white;
width: 100%;
float: none;
margin-bottom: 2px;
}

div.ColVis_catcher {
position: absolute;
/*z-index: 1101;*/
z-index: 11010;
}

(原始值已被注释掉。)

这些改变对我来说似乎足够了,但没有效果。 Bootstrap 模式的 z-index 值可在名为 bootstrap.css 的文件中找到。这是类(class):

.modal {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
display: none;
overflow: auto;
overflow-y: scroll;
}

有人知道我需要做什么吗?

最佳答案

这是一个 z-index 顺序问题。旧的 colVis 扩展已停用,请尝试使用按钮的 colVis 扩展,如果问题仍然存在,请在 css 中使用以下代码:

 .dt-button-background {
z-index: 1 !important;
}
.dt-button-collection {
z-index: 2 !important;
}

关于jquery - ColVis 选择出现在 Bootstrap Modal 后面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24890461/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com