效果预览
<Script Language="JavaScript"> <!-- Begin function show2() { var msg; var timedate= new Date("1/26/2009 09:00:00"); var times=""; var now = new Date(); var leave = timedate.getTime() - now.getTime(); var time = Math.floor(leave /(1000 * 60 * 60 * 24)); var hour = Math.floor((leave%(1000 * 60 * 60 * 24))/(1000 * 60 * 60)); var second = Math.floor((leave%(1000 * 60 * 60 * 24))%(1000 * 60 * 60)/(1000*60)); var m = Math.floor(((leave%(1000 * 60 * 60 * 24))%(1000 * 60 * 60)%(1000*60))/1000); if (m > 0) ; stick1.innerHTML="现在离2010春节"+times+"还有: <font color=red><b>"+time+"</font>天<font
color=#ff0000>"+hour+"</font>小时<font color=#ff0000>"+second+"</font>分<font
color=#ff0000>"+m+"</font>秒"; msg="祝各位工作愉快,身体健康!"; stick2.innerHTML="<b style='font-size:12;'>"+msg+"</b>"; } window.setInterval('show2()',1000); window.onload=show2; // End --> </Script> <div id="stick1"></div> <div id="stick2"></div> |