Joekoe CMS 4.0 Beta1 发布倒计时代码
作者:cmscn 日期:2006-11-10
<div id="time_conter" style="width:100%; padding-top:150px; text-align:center; display:none; color:#808080; font-family:arial; font-weight:bold;">
<p>Joekoe CMS 4.0 Beta1 发布倒计时</p>
<div style="font-size:38px;"><span id=h></span>小时<span id=m></span>分<span id=s></span>秒<span id=ms></span>毫秒</div>
</div>
<script language=javascript>
function n2(n)
{
if(n < 10)return "0" + n.toString();
return n.toString();
}
function n3(n)
{
if(n < 10)return "00" + n.toString();
if(n < 100)return "0" + n.toString();
return n.toString();
}
function setLeft()
{
var d1 = new Date();
var n;
n = (d.getTime() - d1.getTime());
document.getElementById("ms").innerHTML = n3(n % 1000);
n = (n - n % 1000) / 1000;
document.getElementById("s").innerHTML = n2(n % 60);
n = (n - n % 60) / 60;
document.getElementById("m").innerHTML = n2(n % 60);
n = (n - n % 60) / 60;
document.getElementById("h").innerHTML = n2(n);
setTimeout("setLeft();", 1);
}
var a, a1, a2;
a = unescape("2006-11-10 20:00:00").split(" ");
if(a.length > 1)
{
document.getElementById("time_conter").style.display="";
a1 = a[0].split("-");
a2 = a[1].split(":");
var d = new Date(a1[0], a1[1] - 1, a1[2], a2[0], a2[1]);
setLeft();
}
</script>
保存为.asp
http://www.joekoe.com/free/4.0/beta1.asp
评论: 8 | 引用: 0 | 查看次数: 1101
发表评论