参考网页变灰:https://blog.csdn.net/oopxiajun2011/article/details/105318044
人名日报图片点击后由灰色变回彩色:https://mp.weixin.qq.com/s/JSntpqo0zi7ZsEC0K-xKpA
我自己花了2分钟搞了一个类似于人民日报 这个效果。
<html>
<head>网页内容逐步变灰</head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<body>
<img style=" -webkit-filter: grayscale(100%);" src="17630702.jpg"></img>
<script>
var int;
var vue=100;
function change(){
if(vue>0){
vue=vue-1;
$('img').attr("style","-webkit-filter: grayscale("+vue+"%);");
}
else{
clearInterval(int);
}
}
$('img').click(function(){
int=self.setInterval("change()",100);
})
</script>
</body>
</html>