日期:2014-05-16  浏览次数:20578 次

求 js倒计时代码 到了时间后 开始执行下一个命令
求 js倒计时代码 到了时间后 开始执行下一个命令

哪位会的帮我写下 行吗

------解决方案--------------------
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.util.*"%>
<html>
<head>
<title>倒计时页面</title>
</head>
<body target="NZCRM"><form name=loading >
<table width="100%" height="100%" align="center" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td>

<P align=center><FONT face=Arial color=#0066ff size=2>loading...</FONT> <INPUT 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bolder; PADDING-BOTTOM: 0px; COLOR: #0066ff; BORDER-TOP-style: none; PADDING-TOP: 0px; FONT-FAMILY: Arial; BORDER-RIGHT-style: none; BORDER-LEFT-style: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-style: none" 
size=46 name=chart> <BR><INPUT 
style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; COLOR: #0066ff; BORDER-BOTTOM: medium none; TEXT-ALIGN: center" 
size=47 name=percent>
</td></tr>
</table> 
<SCRIPT> 
var bar=0 
var line="||" 
var amount="||" 
count(); 
function count(){ 
bar=bar+1
amount =amount + line 
document.loading.chart.value=amount 
document.loading.percent.value=bar+"%" 
if (bar<10) 
{setTimeout("count()",1000);}//按秒倒计时,十秒后执行else代码 
else //到时间执行else中的代码
{ window.opener=null; 
 window.close() ;
 window.open('Main/Index2_1.jsp','NZCRM','top=0,left=0,fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height='+ new String(screen.availHeight-28) + ',width=' + new String(screen.availWidth-10));
 } 
 
}</SCRIPT>
</P>
</form>
</body>
</html>
------解决方案--------------------
HTML code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>

<script language="JavaScript">  
<!-- //  
var overDate = 1000 * 60 * 60 * 24 * 3;//截止时间:为当前计算机时间+3天  
var NowTime = new Date();  
//var EndTime= new Date(2009,01,11,0,0);   
var EndTime= new Date(NowTime.getTime() + overDate);  
var EndTimeMsg = EndTime.getFullYear() + "年";  
EndTimeMsg = EndTimeMsg + (EndTime.getMonth()+1) + "月";  
EndTimeMsg = EndTimeMsg + (EndTime.getDate()) + "日";  
EndTimeMsg = EndTimeMsg + (EndTime.getHours()) + "时";  
EndTimeMsg = EndTimeMsg + (EndTime.getMinutes()) + "分";  
EndTimeMsg = EndTimeMsg + (EndTime.getSeconds()) + "秒";  
function GetRTime(){  
  
    NowTime = new Date();  
    var nMS=EndTime.getTime() - NowTime.getTime();  
    var nD=Math.floor(nMS/(1000 * 60 * 60 * 24));  
    var nH=Math.floor(nMS/(1000*60*60)) % 24;  
    var nM=Math.floor(nMS/(1000*60)) % 60;  
    var nS=Math.floor(nMS/1000) % 60;  
   // var nMS=Math.floor(nMS/100) % 10;  
    if(nD>= 0){  
        document.getElementById("RemainD").innerHTML=nD;  
        document.getElementById("RemainH").innerHTML=nH;  
        document.getElementById("RemainM"