JS倒计时网页自动跳转代码
<title>JS倒计时网页自动跳转代码</title> <script language="JavaScript" type="text/javascript"> function delayURL(url) { var delay = document.getElementById("time").innerHTML; if(delay > 0) { delay--; document.getElementById("time").innerHTML = delay; } else { window.top.location.href = url; } t = setTimeout("delayURL('" + url + "')", 1000); } function stop1(){ t && clearTimeout(t); } </script> <span id="time" style="background: #00BFFF">1000</span>秒钟后自动跳转,如果不跳转,请点击下面的链接<a href="http://www.baidu.com">我的百度</a> <input type="button" value="停止跳转" onclick="stop1();"> <script type="text/javascript"> delayURL("http://www.baidu.com"); </script>
起点在哪,或许选择不了。重要的是,你追求的终点在哪!