- <b><font color="blue">奥运会开幕还有:</font>
- <font color="red"><span id="timeDate">载入天数...</span><span id="times">载入秒数...</span>
- <script type="text/javascript"><!--
- var now = new Date();
- function createtime(){
- var grt= new Date("8/08/2008 20:00:00");
- now.setTime(now.getTime()+250);
- days = (grt - now) / 1000 / 60 / 60 / 24;
- dnum = Math.floor(days);
- hours = (grt - now) / 1000 / 60 / 60 - (24 * dnum);
- hnum = Math.floor(hours);
- if(String(hnum).length ==1 ){hnum = "0" + hnum;}
- minutes = (grt - now) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
- mnum = Math.floor(minutes);
- if(String(mnum).length ==1 ){mnum = "0" + mnum;}
- seconds = (grt - now) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
- snum = Math.round(seconds);
- if(String(snum).length ==1 ){snum = "0" + snum;}
- document.getElementById("timeDate").innerHTML = dnum+"天";
- document.getElementById("times").innerHTML = hnum + ":" + mnum + ":" + snum;
- }
- setInterval("createtime()",250);
- // --></script>
- </font></b>
Posts Tagged ‘倒计时’
网页上JS显示倒计时
星期六, 7月 12th, 2008关注北京2008 - 奥运倒计时flash插件
星期五, 11月 9th, 2007在侧栏加了个北京2008奥运倒计时flash插件
【注意】时间取的是本地计算机时间(您正在使用的电脑),因为考虑到网络连接接入以及程序的复杂度,因此没有取标准的北京时间,所以如果您自己的电脑时间设置错误,这个倒计时肯定是有所偏差的。这一点也希望大家多多理解。其实解决方案,用ServerProxy或者WebService都可以搞定,等我忙完之后也会考虑来补上。 目前发现有大量反向链接来到这个地址,有一些似乎是“Spam Site”,申明一下,这里只是我的个人blog而已,任何使用这个倒计时牌的网站均与我没有任何关系。
140X260 版:
- <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版
- <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>
