這個(gè)怎么設(shè)置兩秒后登陸?
設(shè)置時(shí)間跳轉(zhuǎn)
蝴蝶不菲
2018-08-12 07:10:44
TA貢獻(xiàn)1834條經(jīng)驗(yàn) 獲得超8個(gè)贊
<script type="text/javascript"> //設(shè)定倒數(shù)秒數(shù) var t = 8; //顯示倒數(shù)秒數(shù) function showTime(){ t -= 1; document.getElementById('div1').innerHTML='<h5 style="color:#9a9a9a;">頁(yè)面將在'+t+'秒內(nèi)跳轉(zhuǎn)到登錄頁(yè)。</h5>'; if(t==0){ location.href='login.htm'; } //每秒執(zhí)行一次,showTime() setTimeout("showTime()",1000); } //執(zhí)行showTime() showTime(); </script>
舉報(bào)