2个回答
推荐于2016-03-29
展开全部
<meta http-equiv="Page-Enter" content="revealTrans(duration=10, transition=4)"><SCRIPT LANGUAGE="JavaScript">
var maxtime ="3";
function CountDown(){
if(maxtime>=0){
minutes = Math.floor(maxtime/60);
seconds = Math.floor(maxtime%60);
msg = "你的文字说明"+minutes+"分"+seconds+"秒";//动态显示剩余时间。
document.all["timer"].innerHTML=msg;
//if(maxtime == 3) document.all["timer"].innerHTML='只剩3秒!';
--maxtime;
}
else{
clearInterval(timer);
document.all["timer"].innerHTML='123';
}
}
timer = setInterval("CountDown()",1000);
</SCRIPT>
<div id=timer></div>
var maxtime ="3";
function CountDown(){
if(maxtime>=0){
minutes = Math.floor(maxtime/60);
seconds = Math.floor(maxtime%60);
msg = "你的文字说明"+minutes+"分"+seconds+"秒";//动态显示剩余时间。
document.all["timer"].innerHTML=msg;
//if(maxtime == 3) document.all["timer"].innerHTML='只剩3秒!';
--maxtime;
}
else{
clearInterval(timer);
document.all["timer"].innerHTML='123';
}
}
timer = setInterval("CountDown()",1000);
</SCRIPT>
<div id=timer></div>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-11-04
展开全部
简单的一种:<script language="JavaScript">
var urodz= new Date("3/30/2005");
var s="离xx节日";
var now = new Date();
var ile = urodz.getTime() - now.getTime();
var dni = Math.floor(ile / (1000 * 60 * 60 * 24));
if (dni > 1)
document.write(""+s+"还有"+dni +"天")
else if (dni == 1)
document.write("只有2天啦!")
else if (dni == 0)
document.write("只有1天啦!")
else
document.write("好象已经过了哦!");
</script> 复杂一些的:<br>距离考试还有<br>
<span id="span_dt_dt" style='border:1px solid black;background-color:#FFFFFF' ></span>
<SCRIPT language=javascript>
<!--
//document.write("");function show_student163_time(){
window.setTimeout("show_student163_time()", 1000);
BirthDay=new Date("04-01-2005");//改成你的计时日期
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);
span_dt_dt.innerHTML=daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒" ;
}
show_student163_time();
//-->
</SCRIPT>
var urodz= new Date("3/30/2005");
var s="离xx节日";
var now = new Date();
var ile = urodz.getTime() - now.getTime();
var dni = Math.floor(ile / (1000 * 60 * 60 * 24));
if (dni > 1)
document.write(""+s+"还有"+dni +"天")
else if (dni == 1)
document.write("只有2天啦!")
else if (dni == 0)
document.write("只有1天啦!")
else
document.write("好象已经过了哦!");
</script> 复杂一些的:<br>距离考试还有<br>
<span id="span_dt_dt" style='border:1px solid black;background-color:#FFFFFF' ></span>
<SCRIPT language=javascript>
<!--
//document.write("");function show_student163_time(){
window.setTimeout("show_student163_time()", 1000);
BirthDay=new Date("04-01-2005");//改成你的计时日期
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);
span_dt_dt.innerHTML=daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒" ;
}
show_student163_time();
//-->
</SCRIPT>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询