我在 Angular5 项目中有一个 Vis.js 时间线,其中包含三个组和多个项目/事件。我想出了如何单独设置每个组背景的样式,以使交替的泳道更加明显,方法是:
.vis-background>.vis-group:nth-of-type(even) {
// there is an auto-generated empty group as the first .vis-group, so starting with the 2nd group
background-color: $gray-lighter;
}
.vis-labelset>.vis-label:nth-of-type(odd) {
background-color: $gray-lighter;
}
但是,垂直背景网格线在灰色组中不再可见。就好像组背景颜色分层在网格线之上。如果我添加z-index: 1;到.vis-vertical或.vis-grid线条和组颜色正确显示,但我失去了时间线缩放和移动功能。如何将样式应用于组,保持垂直网格线可见并保持所有时间线功能?
