HTML图片置灰(一般用于奖品被领取后)

xiaoxiao2021-02-28  12

.gray { -webkit-filter: grayscale(50%); -moz-filter: grayscale(50%); -ms-filter: grayscale(50%); -o-filter: grayscale(50%); filter: grayscale(50%); filter: gray; margin:0.50rem 0rem 0.2rem 0rem; border-radius:0.2rem }

被领取后的js方法设置以上样式即可

document.getElementById("id").setAttribute('class','gray');

转载请注明原文地址: https://www.6miu.com/read-450294.html

最新回复(0)