1

我在触摸/单击时向 div 添加一个暗阴影(作为前元素),并在效果完成后将其删除。

第一次点击似乎很好,但在随后的点击中,效果变得越来越暗(直到它完全变黑)。

好像有多层之前的

到目前为止,我发现的唯一解决方案是将 div 的显示属性设置为“显示:块”,但这需要我进行一些布局返工。还有其他建议吗?

这是我用来设置突出显示的类

.myDivCls:before
{
background-repeat: no-repeat;
background-size: 100% 100%;
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
opacity: .3;
background-color: rgb(0,0,0);
}

她是删除它的人:

.noEffectCls:before {
content: '';
background-color: transparent;
background-image: none;
position: static;
border-radius: 0;
background-size: auto auto;
background-repeat: repeat;
background-position: 0% 0%;
-webkit-background-size: auto auto;
}

谢谢!

4

1 回答 1

0

您是否尝试过在 .noEffectCls:before 元素上使用背景速记属性并将其设置为透明?

于 2013-02-11T21:10:43.707 回答