html页面中设置倒计时
在HTML页面中是不是不能使用两个倒计时?如果可以,是不是需要使用不同的代码?请高手提供一下两者的代码!第一组是奥运倒计时的代码,本人已经从腾迅网站上的倒计时里面获取了,...
在HTML页面中是不是不能使用两个倒计时?如果可以,是不是需要使用不同的代码?请高手提供一下两者的代码!
第一组是奥运倒计时的代码,本人已经从腾迅网站上的倒计时里面获取了,希望高手提供另外的不同的代码!
本人获取的代码如下:
<TBODY>
<TR>
<TD vAlign=top width=200>
<TBODY>
<TR>
<TD>
<TABLE width=234 height="60"
border=0 align=center cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD colSpan=2 height=24><div align="center" class="STYLE3">距08年8月8日 奥运会开幕还有</div></TD></TR>
<TR>
<TD width="87" align=middle class=fb id=timeDate><div align="center" class="STYLE3">660天</div></TD>
<TD width="147"
align=middle class=fb id=times><div align="center" class="STYLE3">18:09:53</div></TD>
</TR></TBODY></TABLE>
<SCRIPT>
var now = new Date();
function createtime(){
var grt= new Date("8/08/2008 20:00:00");
now.setTime(now.getTime()+250);
days = (grt - now) / 1000 / 60 / 60 / 24;
dnum = Math.floor(days);
hours = (grt - now) / 1000 / 60 / 60 - (24 * dnum);
hnum = Math.floor(hours);
if(String(hnum).length ==1 ){hnum = "0" + hnum;}
minutes = (grt - now) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
mnum = Math.floor(minutes);
if(String(mnum).length ==1 ){mnum = "0" + mnum;}
seconds = (grt - now) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
snum = Math.round(seconds);
if(String(snum).length ==1 ){snum = "0" + snum;}
document.getElementById("timeDate").innerHTML = dnum+"天";
document.getElementById("times").innerHTML = hnum + ":" + mnum + ":" + snum;
}
setInterval("createtime()",250);
</SCRIPT>
</TD></TR></TBODY></TABLE>
希望你们可以提供另外的不同的代码,可以实现一个网页中有两个倒计时!
另外,本人想实现的另一个倒计时是生日倒计时! 展开
第一组是奥运倒计时的代码,本人已经从腾迅网站上的倒计时里面获取了,希望高手提供另外的不同的代码!
本人获取的代码如下:
<TBODY>
<TR>
<TD vAlign=top width=200>
<TBODY>
<TR>
<TD>
<TABLE width=234 height="60"
border=0 align=center cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD colSpan=2 height=24><div align="center" class="STYLE3">距08年8月8日 奥运会开幕还有</div></TD></TR>
<TR>
<TD width="87" align=middle class=fb id=timeDate><div align="center" class="STYLE3">660天</div></TD>
<TD width="147"
align=middle class=fb id=times><div align="center" class="STYLE3">18:09:53</div></TD>
</TR></TBODY></TABLE>
<SCRIPT>
var now = new Date();
function createtime(){
var grt= new Date("8/08/2008 20:00:00");
now.setTime(now.getTime()+250);
days = (grt - now) / 1000 / 60 / 60 / 24;
dnum = Math.floor(days);
hours = (grt - now) / 1000 / 60 / 60 - (24 * dnum);
hnum = Math.floor(hours);
if(String(hnum).length ==1 ){hnum = "0" + hnum;}
minutes = (grt - now) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
mnum = Math.floor(minutes);
if(String(mnum).length ==1 ){mnum = "0" + mnum;}
seconds = (grt - now) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
snum = Math.round(seconds);
if(String(snum).length ==1 ){snum = "0" + snum;}
document.getElementById("timeDate").innerHTML = dnum+"天";
document.getElementById("times").innerHTML = hnum + ":" + mnum + ":" + snum;
}
setInterval("createtime()",250);
</SCRIPT>
</TD></TR></TBODY></TABLE>
希望你们可以提供另外的不同的代码,可以实现一个网页中有两个倒计时!
另外,本人想实现的另一个倒计时是生日倒计时! 展开
3个回答
展开全部
<TBODY>
<TR>
<TD vAlign=top width=200>
<TBODY>
<TR>
<TD>
<TABLE width=234 height="60"
border=0 align=center cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD colSpan=2 height=24><div align="center" class="STYLE3">距08年8月8日 奥运会开幕还有</div></TD></TR>
<TR>
<TD width="87" align=middle class=fb id=timeDate><div align="center" class="STYLE3">660天</div></TD>
<TD width="147"
align=middle class=fb id=times><div align="center" class="STYLE3">18:09:53</div></TD>
</TR></TBODY></TABLE>
<SCRIPT>
var now = new Date();
function createtime(){
var grt= new Date("8/08/2008 20:00:00");
now.setTime(now.getTime()+250);
days = (grt - now) / 1000 / 60 / 60 / 24;
dnum = Math.floor(days);
hours = (grt - now) / 1000 / 60 / 60 - (24 * dnum);
hnum = Math.floor(hours);
if(String(hnum).length ==1 ){hnum = "0" + hnum;}
minutes = (grt - now) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
mnum = Math.floor(minutes);
if(String(mnum).length ==1 ){mnum = "0" + mnum;}
seconds = (grt - now) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
snum = Math.round(seconds);
if(String(snum).length ==1 ){snum = "0" + snum;}
document.getElementById("timeDate").innerHTML = dnum+"天";
document.getElementById("times").innerHTML = hnum + ":" + mnum + ":" + snum;
}
setInterval("createtime()",250);
</SCRIPT>
</TD></TR></TBODY></TABLE>
<TR>
<TD vAlign=top width=200>
<TBODY>
<TR>
<TD>
<TABLE width=234 height="60"
border=0 align=center cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD colSpan=2 height=24><div align="center" class="STYLE3">距08年8月8日 奥运会开幕还有</div></TD></TR>
<TR>
<TD width="87" align=middle class=fb id=timeDate><div align="center" class="STYLE3">660天</div></TD>
<TD width="147"
align=middle class=fb id=times><div align="center" class="STYLE3">18:09:53</div></TD>
</TR></TBODY></TABLE>
<SCRIPT>
var now = new Date();
function createtime(){
var grt= new Date("8/08/2008 20:00:00");
now.setTime(now.getTime()+250);
days = (grt - now) / 1000 / 60 / 60 / 24;
dnum = Math.floor(days);
hours = (grt - now) / 1000 / 60 / 60 - (24 * dnum);
hnum = Math.floor(hours);
if(String(hnum).length ==1 ){hnum = "0" + hnum;}
minutes = (grt - now) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
mnum = Math.floor(minutes);
if(String(mnum).length ==1 ){mnum = "0" + mnum;}
seconds = (grt - now) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
snum = Math.round(seconds);
if(String(snum).length ==1 ){snum = "0" + snum;}
document.getElementById("timeDate").innerHTML = dnum+"天";
document.getElementById("times").innerHTML = hnum + ":" + mnum + ":" + snum;
}
setInterval("createtime()",250);
</SCRIPT>
</TD></TR></TBODY></TABLE>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<TBODY>
<TR>
<TD vAlign=top width=200>
<TBODY>
<TR>
<TD>
<TABLE width=234 height="60"
border=0 align=center cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD colSpan=2 height=24><div align="center" class="STYLE3">距08年8月8日 奥运会开幕还有</div></TD></TR>
<TR>
<TD align=middle class=fb id=timeDate><div align="center" class="STYLE3">660天</div></TD>
<TD
align=middle class=fb id=times><div align="center" class="STYLE3">18:09:53</div></TD>
</TR>
<TR>
<TD colspan="2" align=middle class=fb id=timeDate><div align="center"><span class="STYLE3"><br>
距08年7月8日</span> 生日还有</div></TD>
</TR>
<TR>
<TD width="87" align=middle class=fb id=timeDate2><div align="center" class="STYLE3"></div></TD>
<TD width="147"
align=middle class=fb id=times2><div align="center" class="STYLE3"></div></TD>
</TR></TBODY></TABLE>
<SCRIPT>
var now = new Date();
function createtime(){
var grt= new Date("8/08/2008 20:00:00");
now.setTime(now.getTime()+250);
days = (grt - now) / 1000 / 60 / 60 / 24;
dnum = Math.floor(days);
hours = (grt - now) / 1000 / 60 / 60 - (24 * dnum);
hnum = Math.floor(hours);
if(String(hnum).length ==1 ){hnum = "0" + hnum;}
minutes = (grt - now) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
mnum = Math.floor(minutes);
if(String(mnum).length ==1 ){mnum = "0" + mnum;}
seconds = (grt - now) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
snum = Math.round(seconds);
if(String(snum).length ==1 ){snum = "0" + snum;}
document.getElementById("timeDate").innerHTML = dnum+"天";
document.getElementById("times").innerHTML = hnum + ":" + mnum + ":" + snum;
}
function createtime2(){
var grt= new Date("7/08/2008 20:00:00");
now.setTime(now.getTime()+250);
days = (grt - now) / 1000 / 60 / 60 / 24;
dnum = Math.floor(days);
hours = (grt - now) / 1000 / 60 / 60 - (24 * dnum);
hnum = Math.floor(hours);
if(String(hnum).length ==1 ){hnum = "0" + hnum;}
minutes = (grt - now) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
mnum = Math.floor(minutes);
if(String(mnum).length ==1 ){mnum = "0" + mnum;}
seconds = (grt - now) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
snum = Math.round(seconds);
if(String(snum).length ==1 ){snum = "0" + snum;}
document.getElementById("timeDate2").innerHTML = dnum+"天";
document.getElementById("times2").innerHTML = hnum + ":" + mnum + ":" + snum;
}
setInterval("createtime()",250);
setInterval("createtime2()",250);
</SCRIPT>
</TD></TR></TBODY></TABLE>
<TR>
<TD vAlign=top width=200>
<TBODY>
<TR>
<TD>
<TABLE width=234 height="60"
border=0 align=center cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD colSpan=2 height=24><div align="center" class="STYLE3">距08年8月8日 奥运会开幕还有</div></TD></TR>
<TR>
<TD align=middle class=fb id=timeDate><div align="center" class="STYLE3">660天</div></TD>
<TD
align=middle class=fb id=times><div align="center" class="STYLE3">18:09:53</div></TD>
</TR>
<TR>
<TD colspan="2" align=middle class=fb id=timeDate><div align="center"><span class="STYLE3"><br>
距08年7月8日</span> 生日还有</div></TD>
</TR>
<TR>
<TD width="87" align=middle class=fb id=timeDate2><div align="center" class="STYLE3"></div></TD>
<TD width="147"
align=middle class=fb id=times2><div align="center" class="STYLE3"></div></TD>
</TR></TBODY></TABLE>
<SCRIPT>
var now = new Date();
function createtime(){
var grt= new Date("8/08/2008 20:00:00");
now.setTime(now.getTime()+250);
days = (grt - now) / 1000 / 60 / 60 / 24;
dnum = Math.floor(days);
hours = (grt - now) / 1000 / 60 / 60 - (24 * dnum);
hnum = Math.floor(hours);
if(String(hnum).length ==1 ){hnum = "0" + hnum;}
minutes = (grt - now) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
mnum = Math.floor(minutes);
if(String(mnum).length ==1 ){mnum = "0" + mnum;}
seconds = (grt - now) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
snum = Math.round(seconds);
if(String(snum).length ==1 ){snum = "0" + snum;}
document.getElementById("timeDate").innerHTML = dnum+"天";
document.getElementById("times").innerHTML = hnum + ":" + mnum + ":" + snum;
}
function createtime2(){
var grt= new Date("7/08/2008 20:00:00");
now.setTime(now.getTime()+250);
days = (grt - now) / 1000 / 60 / 60 / 24;
dnum = Math.floor(days);
hours = (grt - now) / 1000 / 60 / 60 - (24 * dnum);
hnum = Math.floor(hours);
if(String(hnum).length ==1 ){hnum = "0" + hnum;}
minutes = (grt - now) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
mnum = Math.floor(minutes);
if(String(mnum).length ==1 ){mnum = "0" + mnum;}
seconds = (grt - now) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
snum = Math.round(seconds);
if(String(snum).length ==1 ){snum = "0" + snum;}
document.getElementById("timeDate2").innerHTML = dnum+"天";
document.getElementById("times2").innerHTML = hnum + ":" + mnum + ":" + snum;
}
setInterval("createtime()",250);
setInterval("createtime2()",250);
</SCRIPT>
</TD></TR></TBODY></TABLE>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
bu dao
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询