首页 > 代码库 > Jquery SetTimeOut

Jquery SetTimeOut

倒计时 59 秒:

var c=59var tfunction timedCount(){document.getElementById(txt).value=http://www.mamicode.com/cif(c>0){c--;}else{clearTimeout(t);}t=setTimeout("timedCount()",1000)}</script>

 计时器设置一个时钟:

function startTime(){var today=new Date()var h=today.getHours()var m=today.getMinutes()var s=today.getSeconds()m=checkTime(m)s=checkTime(s)document.getElementById(txt).innerHTML=h+":"+m+":"+st=setTimeout(startTime(),500)}function checkTime(i){if (i<10)   {i="0" + i}  return i}

 

Jquery SetTimeOut