15秒倒计时跳转

2018-03-19  本文已影响0人  jiaomeichen
var wait = 15,
    timer;
time($(".myRead"));
function time(o) {
    if(wait == 0) {
        o.removeAttr("disabled");
        o.removeClass("myRead_time")
        o.html("已阅读并同意");
        wait = 15;
    } else {
        o.attr("disabled", true);
        o.html("已阅读并同意(" + wait + "s)");
        wait--;
        timer = setTimeout(function() {
            time(o)
        }, 1000)
    }
}
上一篇 下一篇

猜你喜欢

热点阅读