过期域名预定抢注

 找回密碼
 免费注册

貼個奧運倒計時的代碼!

[複製鏈接]
發表於 2007-8-10 12:08:44 | 顯示全部樓層 |閱讀模式
奧運倒計時<span id="timeDate">載入天數...</span><span id="times">載入倒計時秒...</span>
$ U( A% y+ O8 g, X& R  l9 e5 a<script>
2 Z. K* J8 Z- I( ]0 J" ]9 _var now = new Date();
/ Y: Y3 q. ^% x% n+ D( U: ]0 Bfunction createtime(){* y, b* m) G+ d  i7 L
) D8 v3 v. R3 P( F
var grt= new Date("8/08/2008 20:00:00");
/ }2 ~- h5 v* ~
2 N" g; F: f& D5 K9 \now.setTime(now.getTime()+250);. h/ e$ A8 Z) S! n4 E( u
days = (grt - now) / 1000 / 60 / 60 / 24;: U! x, L" F8 a" ?  I5 {
dnum = Math.floor(days);# o; T  C$ x* S2 `1 X6 a
hours = (grt - now) / 1000 / 60 / 60 - (24 * dnum);+ a7 @. B; B& x' f2 N
hnum = Math.floor(hours);- D: M0 t! I3 c( g+ k
if(String(hnum).length ==1 ){hnum = "0" + hnum;}
% w+ _7 g$ s6 @minutes = (grt - now) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);6 |" t: x/ b, h8 `5 U: [
mnum = Math.floor(minutes);2 t/ m' H4 R# E; a( t) \0 i9 K
if(String(mnum).length ==1 ){mnum = "0" + mnum;}
% }3 W1 s& B  G- P. _( O# q! cseconds = (grt - now) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
+ `% w! t. O3 ^+ e7 \5 Rsnum = Math.round(seconds);
0 g) S* G2 A, fif(String(snum).length ==1 ){snum = "0" + snum;}
, Z- v2 D% z! L" u  Z5 i$ t* I! ~. k, T' r* \/ t8 g$ x5 K
document.getElementById("timeDate").innerHTML = dnum+"天";3 o! `5 o" k; v* M* T+ I7 B
document.getElementById("times").innerHTML = hnum + ":" + mnum + ":" + snum;  y: i: y5 o' s- a- G
}
1 `0 c$ e5 o9 b) V+ ^, b2 t, ]' m( S4 B2 L" G
setInterval("createtime()",250);               
/ B$ ]7 N0 J2 \+ l4 {& w8 y</script>
2 s9 j# d* x) j  t+ [! m
9 q7 G% |: d& Q( \% a9 ]* Y; X+ A/ W2 k) C

4 R! |5 C; b' Y3 h. x! d8 }7 N. w演示:http://www.zzwang.com/
您需要登錄後才可以回帖 登錄 | 免费注册

本版積分規則

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

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

GMT+8, 2024-11-24 01:10

By DZ X3.5

小黑屋

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