网页倒计时程序代码1
<script language="javascript">
var cTime=10;//这个变量是倒计时的秒数设置为10就是10秒
function TimeClose()
{
window.setTimeout('TimeClose()',1000);//让程序每秒重复执行当前函数。
if(cTime<=0)//判断秒数如果为0
CloseWindow_Click();//执行关闭网页的操作
this.ShowTime.innerHTML="倒计时"+cTime+"秒后关闭当前窗口";//显示倒计时时间
cTime--;//减少秒数
}
function CloseWindow_Click()
{
window.close();
}
</script>
<body onLoad="TimeClose();">
<div id="ShowTime">倒计时10秒后关闭当前窗口</div>
<input type="button" name="CloseWindow" onClick="CloseWindow_Click();" value="立即关闭当前网页">
网页倒计时代码3 网页倒计时代码 网页倒计时器 网页中的倒计时
<script language="javascript">
<!--
var WaitTime = 10; //等待的时间,单位秒
function WaitDo(){
if(WaitTime > 0){
putOutMsg.innerHTML = "本页面将在"+ WaitTime +"秒钟后自动关闭";
WaitTime --;
setTimeout("WaitDo()",1000);
}
else
{
window.close();
}
}
//-->
</script>
<style type="text/css">
span,font{font-size:16px; font-weight:bold;}
</style>
<body onLoad="WaitDo();" style="margin:20px;">
<span id="putOutMsg" class="OpenFont"></span>
设置等待时间后,页面倒计时 开始执行跳转网址(下面二个代码)
<div id="text">本页将在<strong id="tt"></strong>后,跳转至:<span id="link"></span></div>
<script type="text/javascript">
<!--
var t = 5;//设置跳转时间:秒
var url = "http://77ya.com";//设置跳转网址
document.getElementById("link").innerHTML="<a href="+url+">"+url+"</a>";
function $(){
ta = t-1;
tb = t+"000";
d = document.getElementById("tt");
d.innerHTML=t;
setInterval("go_to()",1000);
}
$();
function go_to(){
d.innerHTML=ta--;
if(ta<0){
document.write("正在跳转至:<a href="+url+">"+url+"</a>");
location.href=url;
}
else{
return;
}
}
//-->
</script>
再看一个
正在跳转,请耐心等待……<br>将在<span id="TS" style="color:red"></span>秒后跳转。<br>
<!--<font color="red">请注意,目标网站之内容请真伪自辨,皆与本站(www.77ya.com)无关,若发现违法或不健康内容请与本站联系。</font>-->
<script language="JavaScript" type="text/javascript">
//防止引用
if (top.location.href == undefined) {location.href='http://77ya.com/index.html'};
if (self.location.href != top.location.href) {top.location.href=self.location.href;};
</script>
<script language="JavaScript">
document.writeln ('<sc' + 'ript src=rc.asp?key=49457><\/sc' + 'ript>');
var n1 = 8
function gos()
{
n1--;
if (n1 <= 0){n1 = 0};
TS.innerHTML = n1;
vvvvv = setTimeout("gos()",1000);
}
gos();
function gourl()
{
top.location.href = 'http://77ya.com';
}
ttt = setTimeout("gourl()",3000);
</script>
联系客服