根据不同的节日变换图片路径或网站LOGO <img id="alixixi" src="http://alixixi.com/alixixi.gif" alt="阿里西西" /> <script> function DateDiff(asStartDate,asEndDate){ var miStart=Date.parse(asStartDate.replace(/\-/g,'/')); var miEnd=Date.parse(asEndDate.replace(/\-/g,'/')); return (miEnd-miStart)/(1000*24*3600); } function curlogo() { var daytime = new Date().getYear()+"-"+(new Date().getMonth()+1)+"-"+new Date().getDate(); if (DateDiff(daytime,new Date().getYear()+"-05-01")==0) { document.getElementById("alixixi").src="http://alixixi.com/alixixi.gif"; //五一节 } //其它节日请复制下面三行代码修改"-10-01"及图片路径部分代码 else if (DateDiff(daytime,new Date().getYear()+"-10-01")==0) { document.getElementById("alixixi").src="http://alixixi.com/alixixi.gif"; //国庆节 } //其它节日请复制上面三行代码修改"-10-01"及图片路径部分代码 } </script> [提示:可先修改代码再按运行]