2008奥运倒计时



<script language="JavaScript" type="text/javascript">
//<![CDATA[
var ayDate = new Date(2008,7,8,20,0,0);
function CountDown(){
var tsStr = "<span class='fs12'><strong class='fs12'>奥运倒计时:</strong>距离北京奥运会2008年8月8日20时还有<strong style='font-size:18px;color:red;'> ";
var nowDate = new Date();
var tmpDay = ayDate.getTime() - nowDate.getTime();
var toNowHrs = Math.floor(tmpDay / (1000 * 60 * 60));
var toNowDay = Math.floor(toNowHrs / 24);
var Hrs = toNowHrs % 24;
if(toNowDay < 0) toNowDay = 0; 
if(toNowDay != 0) tsStr += toNowDay + " </strong>天 <strong style='font-size:18px;color:red;'>";
 
tsStr += Hrs + " </strong>小时</span>";
document.getElementById("countDown").innerHTML = tsStr;
//alert(tsStr);
}
CountDown();
setInterval("CountDown()",60000);//每分钟更新一次时间;
//]]>
</script>
<script language=javascript> 
<!-- 
//document.write(""); 
function show_date_time()&#123;
window.settimeout("show_date_time()", 1000); 
birthday=new date("8/08/2008 20:00:00");//这个日期是可以修改的 
today=new date(); 
timeold=(birthday.gettime()-today.gettime()); 
sectimeold=timeold/1000 
secondsold=math.floor(sectimeold); 
msperday=24*60*60*1000 
e_daysold=timeold/msperday 
daysold=math.floor(e_daysold); 
e_hrsold=(e_daysold-daysold)*24; 
hrsold=math.floor(e_hrsold); 
e_minsold=(e_hrsold-hrsold)*60; 
minsold=math.floor((e_hrsold-hrsold)*60); 
seconds=math.floor((e_minsold-minsold)*60); 
aoyun.innerhtml="<font color=ff0000>"+daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒"+"</font>" ; 
&#125; 
show_date_time(); 
//--> 
</script>

技术 2008-07-09 00:58:28 通过 网页 浏览(536) 打印

共有0条评论!

发表评论