<!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' type='text/javascript'> var secs =5; //倒计时的秒数 function Load(){ for(var i=secs;i>=0;i--) { window.setTimeout('doUpdate(' + i + ')', (secs-i) * 1000); } } function doUpdate(num) { document.getElementById('ShowDiv').innerHTML = '将在'+num+'秒后自动消失' ; //document.getElementById('hellobaby').innerHTML = '剩余时间:'+ parseInt(num/3600)+'时'+parseInt((num%3600)/60)+'分'+parseInt((num%3600)%60)+'秒' ; //if(num == 0) {var dd=document.getElementById("time");dd.style.display="none";} if(num == 0) {alert("12");window.opener=null;window.open('','_self');window.close();} } </script> </head> <body style="color:#993300"> <div id="time" style="border:1px; color:Gray; height:100px; text-align:center; font-size:18px"> <div id="ShowDiv">这里写欢迎页面,</div> <script language="javascript" type="text/javascript"> Load(); </script> </div> </body> </html>
转载于:https://www.cnblogs.com/wifi/articles/2719599.html