简书富文本编辑测试

2020-06-19  本文已影响0人  可乐_加冰_
var sendstatus = true;
$('#sendCode').click(function () {

    var _this = $(this);
    if (sendstatus) {
        _this.html('60秒重发');
        sendstatus = false;
        sendtime = 60;
        sendevent = setInterval(function () {
            if (sendtime > 0) {
                sendtime--;
                _this.html(sendtime + '秒重发');
                $("#sendCode").attr('disabled', true);
            } else {
                sendstatus = true;
                _this.html('发送验证码');
                clearInterval(sendevent);
                $("#sendCode").attr('disabled', false);
            }
        }, 1000);
    }
});
上一篇 下一篇

猜你喜欢

热点阅读