考试倒计时

let time = 1200; // 总时间/S

window.paper_timer = setInterval(() => {
// 倒计时
time--;
let hh = Math.floor(time / 3600);
let mm = Math.floor(Math.floor(time % 3600) / 60);
let ss = time % 60;
let h_u = hh > 9 ? hh : '0' + hh;
let m_u = mm > 9 ? mm : '0' + mm;
let s_u = ss > 9 ? ss : '0' + ss;
let val = h + ':' + m + ':' + s;


let use_t;
if(h_u != 0) {
use_t = h_u+'时' + m_u+'分' +s_u+'秒';
}else if(h_u == 0) {
if(m_u != 0) {
use_t = m_u+'分'+s_u+'秒';
}else {
use_t = s_u+'秒';
}
}


}, 1000)

 

 

上一篇:Process Control Instrumentation Technology (Chapter 10)


下一篇:Domino 下批量删除邮箱用户个人配置文档及数据库文件