求html网页高手 倒计时代码!
<TBODY><TR><TDvAlign=topwidth=200><TBODY><TR><TD><TABLEwidth=234height="60"border=0al...
<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>
=======================
如上,本人笨,想加入一个框。。。。。。。有分送!
而且很奇怪,网页上只能显示一个。举例是我两个模块,放同样的代码进去只有一个显示!求指教呀高手们!
整体加个框。很简单的框就行了! 展开
3个回答
展开全部
不知道对不对啊 你看看啊
<HTML>
<HEAD>
<TITLE>时间日期篇--倒计时1</TITLE>
</HEAD>
<BODY bgcolor="#fef4d2" onLoad=DownCount()>
<br><br>
<center>
<font color="ffaafa"><h2>时间日期篇--倒计时1</h2></font>
<hr width=300>
<br><br>
<!-- 案例代码1开始 -->
<script language=JavaScript>
<!-- [Step1]: 这里可以设置倒计时的月日年 -->
var theDay = new Date("January 1, 2008")
var DayALL
function DownCount(){
var today = new Date()
var seconds = Math.floor((theDay.getTime() - today.getTime())/1000)
var minutes = Math.floor(seconds/60)
var hours = Math.floor(minutes/60)
var days = Math.floor(hours/24)
CDay= days
CHour= hours % 24
CMinute= minutes % 60
CSecond= seconds % 60
DayALL = CDay + " 天 , " + CHour + " 小时 , " + CMinute + " 分钟 , " + CSecond + " 秒 "
document.clock.DownCount.value = DayALL
var counter = setTimeout("DownCount()", 1000)
}
</script>
<!-- 案例代码1结束 -->
<!-- 案例代码2开始 -->
<form name = "clock">
<!-- [Step2]: 这里可以更该页面上显示的提示信息 -->
距离 2008 年 1 月 1 日,您将还有 <br>
<!-- [Step3]: 这里可以改变时间的列长度 -->
<input type="TEXT" name= "DownCount" size= "35">
</form>
<!-- 案例代码2结束 -->
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>时间日期篇--倒计时1</TITLE>
</HEAD>
<BODY bgcolor="#fef4d2" onLoad=DownCount()>
<br><br>
<center>
<font color="ffaafa"><h2>时间日期篇--倒计时1</h2></font>
<hr width=300>
<br><br>
<!-- 案例代码1开始 -->
<script language=JavaScript>
<!-- [Step1]: 这里可以设置倒计时的月日年 -->
var theDay = new Date("January 1, 2008")
var DayALL
function DownCount(){
var today = new Date()
var seconds = Math.floor((theDay.getTime() - today.getTime())/1000)
var minutes = Math.floor(seconds/60)
var hours = Math.floor(minutes/60)
var days = Math.floor(hours/24)
CDay= days
CHour= hours % 24
CMinute= minutes % 60
CSecond= seconds % 60
DayALL = CDay + " 天 , " + CHour + " 小时 , " + CMinute + " 分钟 , " + CSecond + " 秒 "
document.clock.DownCount.value = DayALL
var counter = setTimeout("DownCount()", 1000)
}
</script>
<!-- 案例代码1结束 -->
<!-- 案例代码2开始 -->
<form name = "clock">
<!-- [Step2]: 这里可以更该页面上显示的提示信息 -->
距离 2008 年 1 月 1 日,您将还有 <br>
<!-- [Step3]: 这里可以改变时间的列长度 -->
<input type="TEXT" name= "DownCount" size= "35">
</form>
<!-- 案例代码2结束 -->
</BODY>
</HTML>
更多追问追答
追问
哥们。。。我不是要这个效果,我要上面的离XXX都框起来。
追答
把要显示的都框在一起啊
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
展开全部
<TBODY>
<TR>
<TD vAlign=top width=200>
<TBODY>
<TR>
<TD>
<p> </p>
<p>示例1:ID分别为timeDate,times</p>
<TABLE width=617 height="24"
border=0 align=center cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD height=24 align="center" class="STYLE3">距08年8月8日 奥运会开幕还有<span id="timeDate">660天</span><span id="times">18:09:53</span></TD>
</TR></TBODY></TABLE>
<p>
</p>
<p> </p>
<p> </p>
<p> </p>
<p>示例2:ID分别为timeDate2,times2</p>
<TABLE width=617 height="24"
border=0 align=center cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD height=24 align="center" class="STYLE3">距08年8月8日 奥运会开幕还有<span id="timeDate2">660天</span><span id="times2">18:09:53</span></TD>
</TR></TBODY></TABLE>
<SCRIPT>
var now = new Date();
function createtime(timeDate,times)
{
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;
}
//执行示例1
setInterval("createtime('timeDate','times')",250);
//执行示例2
setInterval("createtime('timeDate2','times2')",250);
</SCRIPT>
<TR>
<TD vAlign=top width=200>
<TBODY>
<TR>
<TD>
<p> </p>
<p>示例1:ID分别为timeDate,times</p>
<TABLE width=617 height="24"
border=0 align=center cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD height=24 align="center" class="STYLE3">距08年8月8日 奥运会开幕还有<span id="timeDate">660天</span><span id="times">18:09:53</span></TD>
</TR></TBODY></TABLE>
<p>
</p>
<p> </p>
<p> </p>
<p> </p>
<p>示例2:ID分别为timeDate2,times2</p>
<TABLE width=617 height="24"
border=0 align=center cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD height=24 align="center" class="STYLE3">距08年8月8日 奥运会开幕还有<span id="timeDate2">660天</span><span id="times2">18:09:53</span></TD>
</TR></TBODY></TABLE>
<SCRIPT>
var now = new Date();
function createtime(timeDate,times)
{
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;
}
//执行示例1
setInterval("createtime('timeDate','times')",250);
//执行示例2
setInterval("createtime('timeDate2','times2')",250);
</SCRIPT>
更多追问追答
追问
哥们,你的框呢。。。
追答
示例1
距08年8月8日 奥运会开幕还有660天 18:09:53
示例2
距08年8月8日 奥运会开幕还有660天 18:09:53
var now = new Date();
function createtime(timeDate,times)
{
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;
//setTimeout("createtime("+timeDate+","+times+")",250);
}
//执行示例1
setInterval("createtime('timeDate','times')",250);
//执行示例2
setInterval("createtime('timeDate2','times2')",250);
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2011-10-30
展开全部
好心人尽在百度知道!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询