js n秒以后自动跳转...
时间:2010-08-11 来源:kexin_bo
方法一:
等待<span id="daojishi">10</span>秒后你将跳转到http://www.gaoxiaozone.cn <mce:script type="text/javascript"><!-- function daoshu(){ var djs = document.getElementById("daojishi"); if(djs.innerHTML == 0){ window.location.href='http://www.gaoxiaozone.cn'; return false; } djs.innerHTML = djs.innerHTML - 1; } window.setInterval("daoshu()", 1000); // --></mce:script> 方法二:<mce:script type="text/javascript"><!-- var time = 0; var forward_url = "";//某页网址 function forward_to(){ time ++; if(time == 5){ document.location.href = forward_url; } document.getElementById("message").innerHTML = (3 - time) + "秒后自动跳转到某页"; } window.setInterval("forward_to()",1000); // --></mce:script>
相关阅读 更多 +