网站首页置灰

var date = {
  isDuringDate: function (beginDateStr, endDateStr) {
  var curDate = new Date(),
  beginDate = new Date(beginDateStr),
  endDate = new Date(endDateStr);
  if (curDate >= beginDate && curDate <= endDate) {
    return true;
  }
    return false;
  }
}
var flag = date.isDuringDate('2020/04/04 00:00:00', '2020/04/04 23:59:59');
if (flag != false) {
  var json={"filter":"grayscale(100%)","-webkit-filter":"grayscale(100%)","-moz-filter":"grayscale(100%)","-ms-filter":"grayscale(100%)","-o-filter":"grayscale(100%)","filter":"progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)","-webkit-filter":"grayscale(1)"}
  $("html").css(json);
}


// html{ filter: grayscale(100%); -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms-filter: grayscale(100%); -o-filter: grayscale(100%); filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); -webkit-filter: grayscale(1);}

posted on 2020-04-13 18:26  rubytoto  阅读(230)  评论(0编辑  收藏  举报

导航