我有一个涟漪类来为任何HTML元素添加涟漪效果。
.bh-ripple {
position: relative;
overflow: hidden;
transform: translate3d(0, 0, 0);
}
.bh-ripple:after {
content: "";
display: block;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
pointer-events: none;
background-image: radial-gradient(circle, #000 10%, transparent 10.01%);
background-repeat: no-repeat;
background-position: 50%;
transform: scale(10, 10);
opacity: 0;
transition: transform .5s, opacity 1s
}
.bh-ripple:active:after {
transform: scale(0, 0);
opacity: .2;
transition: 0s
}

<div class="bh-header-menu-ct bh-right">
<div class="bh-user-menu bh-ripple">
<div class="bh-user-avatar bh-color-300">
<i class="fa fa-user-circle"></i>
</div>
<div class="bh-user bh-color-500">UserName</div>
<div class="bh-color-700">
<i class="fa fa-caret-down"></i>
</div>
</div>
</div>
&#13;
涟漪效果在Chrome和Firefox上完美运行,但在IE 11上存在问题。第一次点击时不会产生效果。我必须点击div的边缘才能看到效果。