<html>
<head>
<title>倒计时</title>
<style>
.time{color:#ffffff;font-family:verdana,geneva,helveticafont-size:9pt}
a:link{text-decoration:none;color:#000000}
a:active{text-decoration:none;color:#000000}
a:visited{text-decoration:none;color:#000000}
a:hover{text-decoration:none;color:#000000}
</style><script language="javascript">var time_now_client,time_end,time_server_client,timerID;time_end=new Date();
time_end=time_end.getTime() + 60000*100; //20分钟
time_now_client=new Date();
time_now_client=time_now_client.getTime();setTimeout("show_time()",1000);function show_time()
{
timer.innerHTML =time_server_client; var time_now,time_distance,str_time;
var int_hour,int_minute,int_second;
var time_now=new Date();
time_now=time_now.getTime();
time_distance=time_end-time_now;
if(time_distance>0)
{
int_hour=Math.floor(time_distance/3600000)
time_distance-=int_hour*3600000;
int_minute=Math.floor(time_distance/60000)
time_distance-=int_minute*60000;
int_second=Math.floor(time_distance/1000)
if(int_hour<10)
int_hour="0"+int_hour;
if(int_minute<10)
int_minute="0"+int_minute;
if(int_second<10)
int_second="0"+int_second;
str_time=int_hour+":"+int_minute+":"+int_second;
timer.innerHTML=str_time;
setTimeout("show_time()",1000);
}
else
{
timer.innerHTML ="over";
clearTimeout(timerID)
}
}
</script>
<style>
.time{color:#000000;font-family:verdana;font-size:9pt}
</style>
</head><BODY BGCOLOR=#FFFFFF topmargin=2 leftmargin=2>
<div id="Layer1" style="position:absolute; width:160px; height:187px; z-index:1">
<!-- begin calendar -->
<table width=160 border=0 cellpadding=0 cellspacing=0>
<tr>
<td colspan=3> </td>
</tr>
<tr>
<td width="47"> </td>
<td background="images/mail_03.gif" width="67" valign="top">
<table width=65 cellpadding=3 cellspacing=0 border=0>
<tr>
<td align=center class="time">
<a href="http://203.212.7.76:8000/Announcement.html" target=_blank><div id="timer" style="font-size:9pt;color:red"></div></a>
</td>
</tr>
</table>
</td>
<td width="46"> </td>
</tr>
<tr>
<td colspan=3> </td>
</tr>
</table>
<!-- end calendar -->
</div>
</BODY>
</HTML>
<head>
<title>倒计时</title>
<style>
.time{color:#ffffff;font-family:verdana,geneva,helveticafont-size:9pt}
a:link{text-decoration:none;color:#000000}
a:active{text-decoration:none;color:#000000}
a:visited{text-decoration:none;color:#000000}
a:hover{text-decoration:none;color:#000000}
</style><script language="javascript">var time_now_client,time_end,time_server_client,timerID;time_end=new Date();
time_end=time_end.getTime() + 60000*100; //20分钟
time_now_client=new Date();
time_now_client=time_now_client.getTime();setTimeout("show_time()",1000);function show_time()
{
timer.innerHTML =time_server_client; var time_now,time_distance,str_time;
var int_hour,int_minute,int_second;
var time_now=new Date();
time_now=time_now.getTime();
time_distance=time_end-time_now;
if(time_distance>0)
{
int_hour=Math.floor(time_distance/3600000)
time_distance-=int_hour*3600000;
int_minute=Math.floor(time_distance/60000)
time_distance-=int_minute*60000;
int_second=Math.floor(time_distance/1000)
if(int_hour<10)
int_hour="0"+int_hour;
if(int_minute<10)
int_minute="0"+int_minute;
if(int_second<10)
int_second="0"+int_second;
str_time=int_hour+":"+int_minute+":"+int_second;
timer.innerHTML=str_time;
setTimeout("show_time()",1000);
}
else
{
timer.innerHTML ="over";
clearTimeout(timerID)
}
}
</script>
<style>
.time{color:#000000;font-family:verdana;font-size:9pt}
</style>
</head><BODY BGCOLOR=#FFFFFF topmargin=2 leftmargin=2>
<div id="Layer1" style="position:absolute; width:160px; height:187px; z-index:1">
<!-- begin calendar -->
<table width=160 border=0 cellpadding=0 cellspacing=0>
<tr>
<td colspan=3> </td>
</tr>
<tr>
<td width="47"> </td>
<td background="images/mail_03.gif" width="67" valign="top">
<table width=65 cellpadding=3 cellspacing=0 border=0>
<tr>
<td align=center class="time">
<a href="http://203.212.7.76:8000/Announcement.html" target=_blank><div id="timer" style="font-size:9pt;color:red"></div></a>
</td>
</tr>
</table>
</td>
<td width="46"> </td>
</tr>
<tr>
<td colspan=3> </td>
</tr>
</table>
<!-- end calendar -->
</div>
</BODY>
</HTML>
解决方案 »
- 怎么在一张图片上,鼠标经过某人头像时,显示该人的名字(出现一个包含名字的小方框)
- 请问有没有可能无论当前用什么浏览器在看网页,弹出的网页都用IE打开?
- 上海网络公司招聘网页设计(3000-6000RMB)联系方式
- 请问怎么实现类似163邮箱的 点发送选项 下面就弹出选项的功能 ??
- 如何用正刚表达式判断一组字符中是否包含<title></title>这样的字符。
- 求一个正则表达式:要求一字符串只能包含中文,英文字母和数字
- 求如何能够asp+javascript实现邮箱中上传附件那种形式的多文件上传代码
- 打开一个新窗口,想让标题栏隐藏,有甚莫好办法吗!高手指教
- js也可以操作数据库真的吗
- 怎么樣在js中控制表格背景圖片的變換????
- 简单问题,请帮忙呀!
- 这里有一段实现日历选择的JS代码,但我不知道如何调用,请大家指教
<script language=javascript>
//特别注明:北京时间是格林尼治标准时加八小时,因此我用的起始时间也是从八点起算的
var secondServer = <%=DateDiff("s", "1970-01-01 08:00:00", Now())%>;
var secondClient = parseInt(new Date().getTime()/1000);
var secondSub = secondServer - secondClient; //两端时间秒差
function meizzTime(n)
{
var mei = new Date();
mei.setTime(mei.getTime() + n*1000); //得到一个新的时间
var h = (mei.getHours() > 9) ? mei.getHours() : "0" + mei.getHours();
var m = (mei.getMinutes() > 9) ? mei.getMinutes() : "0" + mei.getMinutes();
var s = (mei.getSeconds() > 9) ? mei.getSeconds() : "0" + mei.getSeconds();
document.meizz.clock.value = h +":"+ m +":"+ s;
setTimeout("meizzTime(secondSub)", 1000);
}
</script>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<meta http-equiv="refresh" content="100">
<title>取服务器端时间(秒数)</title>
</head><body onload="meizzTime(secondSub)">
<form name=meizz><input name=clock size=8></form>
</body></html>这段代码是得到服务器端时间的一个例子, 楼主可以将它放到页面里的一个隐藏 iframe 去,这个页面以100秒自动与服务器校对一次(刷新时间楼主可自定), 得到服务器端时间后再写到 parent 页面上去.
呵啊, meizz(梅花雨) ,真是太好了,收藏备用!!!
<html>
<head>
<script>
var counter = 20
var interval_id = setInterval("countdown()", 1000)
function countdown()
{
status = counter--
if(counter < 0)
{
clearInterval(interval_id)
status = ""
}
}
</script>
</head><body>
look downwards!
<br>
the number is count down in the status bar
</body>
</html>