头像
统计阅读文章时间
admin 发表于 2022-03-15 21:20:42

2583 3 0
<div id="tingliu">
    <span class="tingliu2 hint--top hint--bounce" data-hint="希望这篇文章能给你带来收获,去发表评论吧!?"> 
            <a href="##"> class="tingliu5"></a> 
    </span>&nbsp;
    <span class="tingliu2">您阅读这篇文章共花了:</span>&nbsp;<span class="tingliu3" id="stime"></span>
</div>
#tingliu {
    margin: 30px 0px 15px 0px;
    padding: 5px 0px 10px 0px;
    height: 100%;
    line-height: 2;
    text-align: center;
    font-size: 14px;
    background: #F1E8DF;
    border: 1px dashed #CEB8A3;
    width: 100%;
    transition: all 0.2s ease-in-out 0s;
    -moz-transition: all 0.2s ease-in-out 0s;
    -webkit-transition: all 0.2s ease-in-out 0s;
}

.tingliu2 {
    color: #7C4500;
}

.tingliu3 {
    color: #C03131;
}

.tingliu5 {
    position: relative;
    left: 0px;
    top: 5px;
}
<script language="JavaScript">
    var ss = 0,
        mm = 0,
        hh = 0;

    function TimeGo() {
        ss++;
        if (ss >= 60) {
            mm += 1;
            ss = 0
        }
        if (mm >= 60) {
            hh += 1;
            mm = 0
        }
        ss_str = (ss < 10 ? "0" + ss : ss);
        mm_str = (mm < 10 ? "0" + mm : mm);
        tMsg = "" + hh + "小时" + mm_str + "分" + ss_str + "秒";
        document.getElementById("stime").innerHTML = tMsg;
        setTimeout("TimeGo()", 1000)
    }
    TimeGo();
</script>
──── 0人觉得很赞 ────
最新回复 (3)
  • 头像
    初心不改 发表于 2022-03-16 15:56:11
    0 引用 沙发
    感谢楼主ing!!!非常棒!!!
  • 头像
    若如初 发表于 2022-03-24 16:29:46
    0 引用 板凳
    看帖必回是好习惯!
  • 头像
    独乐乐 发表于 2022-11-28 13:27:40
    0 引用 地板
    感谢楼主ing!!!非常棒!!!
    • 折腾BBS
      5
        登录 注册 QQ登录