1
我创建一个简单的提示系统,你可以将一个属性的元素后: <div data-tooltip-content="testing out tooltip.">
选择风格属性的
(PS我使用SASS)
造型:
content: attr(data-tooltip-content)
color: white
background: black
padding: 5px
position: absolute
white-space: nowrap
border-radius: .20rem
margin-top: -2rem
z-index: 14000 !important
pointer-events: none
这些工具提示正在用于显示卡上的信息。当用户点击它们时,这些卡片将被展开并折叠。但是,当我现在在被点击的卡的JavaScript中做el.style['z-index'] = '0';
。然后工具提示会被重叠,因为工具提示的z-index已被JavaScript覆盖,这导致工具提示与其他具有更高z-index的东西重叠。那么是否有方法可以在javascript中更改工具提示的样式