zoukankan      html  css  js  c++  java
  • 考试倒计时

    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)
  • 相关阅读:
    spoj705
    bzoj2440
    spoj220
    bzoj2301
    hdu1695
    poj3294
    hdu3518
    poj3693
    函数
    样式
  • 原文地址:https://www.cnblogs.com/na-w/p/15513891.html
Copyright © 2011-2022 走看看