首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

js三秒自动跳转

2013-11-08 
js3秒自动跳转html headtitle New Document /titlescript languagejavascriptfunction init(

js3秒自动跳转
<html>
 <head>
  <title> New Document </title>
<script language="javascript">   
function init(){
window.setInterval("settime()",1000);   
window.setInterval("skipUrl()",3000);   
}  
function settime(){   
var divinner=document.getElementById("divinner");
if(divinner.innerText>1){
divinner.innerText = divinner.innerText-1;   
}
}
function skipUrl(){
var f_url='http://www.baidu.com';
window.location.replace(f_url);  
}   
</script>  
 </head>
 <body onload="init();">
  <div id="divinner">3</div>
 </body>
</html>

热点排行