过期域名预定抢注

 找回密碼
 免费注册

貼個奧運倒計時的代碼!

[複製鏈接]
發表於 2007-8-10 12:08:44 | 顯示全部樓層 |閱讀模式
奧運倒計時<span id="timeDate">載入天數...</span><span id="times">載入倒計時秒...</span>- Q8 ]# p9 `' p& @' O) Z7 i1 {; z
<script>
8 A8 M. h3 B$ avar now = new Date();. s: |+ Y% E6 [. _* k9 @
function createtime(){
, [. G( Y6 T# T0 _' I6 ~5 ~% ?% w( @# B3 j; {- P
var grt= new Date("8/08/2008 20:00:00");3 k" @# b- [. h$ Q
9 t1 j- T" ?6 p1 A
now.setTime(now.getTime()+250);& l, i) _( O7 X. m4 ^/ j
days = (grt - now) / 1000 / 60 / 60 / 24;
3 ?. w  ]9 Q  J# h# m& g7 }dnum = Math.floor(days);
. G$ N( O# X# T! k% \hours = (grt - now) / 1000 / 60 / 60 - (24 * dnum);" e+ q; @( ]* K5 ?0 _
hnum = Math.floor(hours);) w; \$ X& {2 B8 q5 v
if(String(hnum).length ==1 ){hnum = "0" + hnum;}
. J, P# n5 b$ Aminutes = (grt - now) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);5 ^& n0 p5 A, j2 t2 G3 f$ G: p: H/ ^
mnum = Math.floor(minutes);
6 y; j3 W2 k0 ?% o3 t- _* d2 vif(String(mnum).length ==1 ){mnum = "0" + mnum;}
* {' N3 U& a+ z" n% l2 T# D; zseconds = (grt - now) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
* H( s- \" |, @! i) P$ vsnum = Math.round(seconds);
0 a$ |9 f8 U4 n/ m& p' E+ Aif(String(snum).length ==1 ){snum = "0" + snum;}
' |+ B( g# i" P5 U. c& M# p) g' S5 K: Z. m4 `
document.getElementById("timeDate").innerHTML = dnum+"天";& E; ~" ^2 P9 ?+ C: p
document.getElementById("times").innerHTML = hnum + ":" + mnum + ":" + snum;" s! ~0 \; @( z: R& {4 i1 r
}% A/ X; b) F9 u- L# x" h7 @
8 Q# `: C) C* n8 [2 a0 u
setInterval("createtime()",250);               
3 {, c" Y' k- N& ?5 N! `</script> 2 G3 ^# g8 X# g9 V4 {$ I6 I

; C( ]' t& S; M1 f  m
5 s; k1 z2 R1 V, y: @& V" y- K4 S9 S3 q+ u' m: }; g; h
演示:http://www.zzwang.com/
您需要登錄後才可以回帖 登錄 | 免费注册

本版積分規則

过期高净值品牌域名预定抢注

4um點基跨境網編創業社區

GMT+8, 2024-10-30 23:17

By DZ X3.5

小黑屋

快速回復 返回頂部 返回列表