jq实现倒计时以及完成以后进行操作使用

function count(wait) {
            function time() {
                if (wait == 0) {
                   //倒计时完成以后进行操作
                } else {
                    $("#varifyCode").show().text(wait + "s");//显示倒计时数字
                    wait--;
                    setTimeout(function () {
                        time();
                    }, 1000)
                }
            }
            time();
        }

count(60);

 

posted @ 2018-09-18 11:02  樱花雨纷飞  阅读(683)  评论(0编辑  收藏  举报