:::向5.12地震遇难同胞默哀:::[网站变灰css和js代码]
网站变灰CSS代码: <style type="text/css">html { filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); }
</style>网站变灰js代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>江西广告网</title>
<script type="text/javascript">
function test()
{
var div = document.createElement("div");
div.innerHTML="中国加油,四川加油<style type=\"text/css\">html { filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); } </style>";
div.style.display="none";
document.body.appendChild(div);
alert(div.outerHTML);
}
</script>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
</head>
<body onload="test()">
asdfa<span class="STYLE1">网站变灰js代码</span>
</body>
</html>
还有一个js代码 //2008年5月12日四川汶川发生大地震;
//2008年5月19日至21日为全国哀悼日;
//程序BY: 梅子雨 || 李可先 2008-5-19;
var strDayTime = new Date();
var strMonth = strDayTime.getMonth() + 1;
var strToday = strDayTime.getDate();
if(strMonth == 5){
if(strToday == 12 || strToday == 19 || strToday == 20 || strToday == 21){
document.write("<style type=\"text/css\">");
//document.write(" body,img{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);}");//网页不服从W3C换成这句
//document.write(" html{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);}");//如果网页服从W3C换成这句
document.write("</style>");
} }
页:
[1]