var minus =0;
var second = 0;
var timeCount=0;
function refreshTime(){
timeCount = timeCount+1;
minus = parseInt(timeCount/60);
if(timeCount>=60){
second=parseInt(timeCount%60);
}else{
second = timeCount;
}
if(second<10){
document.getElementById('MsgOfRtu').innerHTML ="通讯中(0"+minus+":"+"0"+second+")...";
}else{
document.getElementById('MsgOfRtu').innerHTML =">通讯中(0"+minus+":"+second+")...";
}
}
resultInterval = setInterval('refreshTime()', 1000);//每秒调用一次
js实现计时器
最新推荐文章于 2024-08-27 13:38:21 发布