此方法能夠給其他的人士看見倒數的秒數!而且支持各大瀏覽器.!!
在網頁之間插入,記得填入網址唷.!!
<script>
<!--
function startCount() {
var countfrom=10 // this controls what number to start counting from
var countnow=document.getElementById('mySeconds').innerHTML=countfrom+1
countAction(countnow)
}
function countAction(countnow) {
if (countnow!=1) {
countnow-=1
document.getElementById('mySeconds').innerHTML=countnow;
} else {
window.location = 'URL地址';
return
}
setTimeout("countAction("+countnow+")",1000)
}
//?
</script>
在網頁適合的地方加上:
<p>本站將會在<span id="mySeconds">10</span>秒內自動轉頁</p>
演示: