網(wǎng)頁(yè)倒計(jì)時(shí)程序代碼1
<script language="javascript">
var cTime=10;//這個(gè)變量是倒計(jì)時(shí)的秒數(shù)設(shè)置為10就是10秒
function TimeClose()
{
window.setTimeout('TimeClose()',1000);//讓程序每秒重復(fù)執(zhí)行當(dāng)前函數(shù)。
if(cTime<=0)//判斷秒數(shù)如果為0
CloseWindow_Click();//執(zhí)行關(guān)閉網(wǎng)頁(yè)的操作
this.ShowTime.innerHTML="倒計(jì)時(shí)"+cTime+"秒后關(guān)閉當(dāng)前窗口";//顯示倒計(jì)時(shí)時(shí)間
cTime--;//減少秒數(shù)
}
function CloseWindow_Click()
{
window.close();
}
</script>
<body onLoad="TimeClose();">
<div id="ShowTime">倒計(jì)時(shí)10秒后關(guān)閉當(dāng)前窗口</div>
<input type="button" name="CloseWindow" onClick="CloseWindow_Click();" value="立即關(guān)閉當(dāng)前網(wǎng)頁(yè)">
網(wǎng)頁(yè)倒計(jì)時(shí)代碼3 網(wǎng)頁(yè)倒計(jì)時(shí)代碼 網(wǎng)頁(yè)倒計(jì)時(shí)器 網(wǎng)頁(yè)中的倒計(jì)時(shí)
<script language="javascript">
<!--
var WaitTime = 10; //等待的時(shí)間,單位秒
function WaitDo(){
if(WaitTime > 0){
putOutMsg.innerHTML = "本頁(yè)面將在"+ WaitTime +"秒鐘后自動(dòng)關(guān)閉";
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>
設(shè)置等待時(shí)間后,頁(yè)面倒計(jì)時(shí) 開(kāi)始執(zhí)行跳轉(zhuǎn)網(wǎng)址(下面二個(gè)代碼)
<div id="text">本頁(yè)將在<strong id="tt"></strong>后,跳轉(zhuǎn)至:<span id="link"></span></div>
<script type="text/javascript">
<!--
var t = 5;//設(shè)置跳轉(zhuǎn)時(shí)間:秒
var url = "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("正在跳轉(zhuǎn)至:<a href="+url+">"+url+"</a>");
location.href=url;
}
else{
return;
}
}
//-->
</script>
再看一個(gè)
正在跳轉(zhuǎn),請(qǐng)耐心等待……<br>將在<span id="TS" style="color:red"></span>秒后跳轉(zhuǎn)。<br>
<!--<font color="red">請(qǐng)注意,目標(biāo)網(wǎng)站之內(nèi)容請(qǐng)真?zhèn)巫员?,皆與本站(www.77ya.com)無(wú)關(guān),若發(fā)現(xiàn)違法或不健康內(nèi)容請(qǐng)與本站聯(lián)系。</font>-->
<script language="JavaScript" type="text/javascript">
//防止引用
if (top.location.href == undefined) {location.};
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.;
}
ttt = setTimeout("gourl()",3000);
</script>
聯(lián)系客服