1. <b><font color="blue">奥运会开幕还有:</font>
  2. <font color="red"><span id="timeDate">载入天数...</span><span id="times">载入秒数...</span>
  3. <script type="text/javascript"><!--
  4. var now = new Date();
  5. function createtime(){
  6.  
  7. var grt= new Date("8/08/2008 20:00:00");
  8.  
  9. now.setTime(now.getTime()+250);
  10. days = (grt - now) / 1000 / 60 / 60 / 24;
  11. dnum = Math.floor(days);
  12. hours = (grt - now) / 1000 / 60 / 60 - (24 * dnum);
  13. hnum = Math.floor(hours);
  14. if(String(hnum).length ==1 ){hnum = "0" + hnum;}
  15. minutes = (grt - now) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
  16. mnum = Math.floor(minutes);
  17. if(String(mnum).length ==1 ){mnum = "0" + mnum;}
  18. seconds = (grt - now) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
  19. snum = Math.round(seconds);
  20. if(String(snum).length ==1 ){snum = "0" + snum;}
  21.  
  22. document.getElementById("timeDate").innerHTML = dnum+"天";
  23. document.getElementById("times").innerHTML = hnum + ":" + mnum + ":" + snum;
  24. }
  25.  
  26. setInterval("createtime()",250);
  27. // --></script>
  28. </font></b>
, , ,

在侧栏加了个北京2008奥运倒计时flash插件

【注意】时间取的是本地计算机时间(您正在使用的电脑),因为考虑到网络连接接入以及程序的复杂度,因此没有取标准的北京时间,所以如果您自己的电脑时间设置错误,这个倒计时肯定是有所偏差的。这一点也希望大家多多理解。其实解决方案,用ServerProxy或者WebService都可以搞定,等我忙完之后也会考虑来补上。 目前发现有大量反向链接来到这个地址,有一些似乎是“Spam Site”,申明一下,这里只是我的个人blog而已,任何使用这个倒计时牌的网站均与我没有任何关系。

140X260 版:

  1. <center><embed src="http://aw.awflasher.com/2008.swf" style="overflow: hidden; width: 140px; height: 260px" type="application/x-shockwave-flash" height="260" width="140"></embed></center>

155X37 mini版

  1. <center><embed src="http://aw.awflasher.com/2008lite.swf" style="overflow: hidden; width: 155px; height: 37px" type="application/x-shockwave-flash" height="37" width="155"></embed></center>

转自aw’s blog

, , , , ,