全站灰色JS代码-指定某些日期变灰
$(function() {
var myDate = new Date;
var mon = myDate.getMonth() + 1;
var date = myDate.getDate();
var days=['4.4','5.12','7.7','9.18','12.13']; //指定日期
for (var day of days) {
var d=day.split('.');
if (mon == d[0] && date == d[1]) {
var gray='grayscale(100%)';
$("html,body").css({"filter":'gray !important;',"filter":"progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)","filter":gray,"-webkit-filter":gray,'-moz-filter':gray,'-ms-filter':gray,'-o-filter':gray});
break;
}
}
});
更多标签请浏览:标签