36、显示离开某事件时间提醒牌

36、显示离开某事件时间提醒牌

要完成此效果把如下代码加入到<body>区域中

 

<SCRIPT language=javascript><!--

 

BirthDay=new Date("january 01,2007");//改成你的计时日期

 

today=new Date();

 

timeold=(today.getTime()-BirthDay.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);

 

//-->

 

</SCRIPT><SCRIPT language=javascript><!--

 

document.write("结婚已经 "+daysold+""+hrsold+"小时"+minsold+""+seconds+"秒了!");

 

//-->

 

</SCRIPT>

 

 

 

 

Write a comment

Comments: 0