JQuery-倒计时显示并跳转

function jump(count) {
            var str = "a word";
            window.setTimeout(function() {
                count--;
                if (count > 0) {
                    $('#id').text(count + str);
                    jump(count);
                } else {
                    location.href = "target";
                }
            }, 1000);//1秒
        }
        $(function() {
            jump(5);
        });

你可能感兴趣的:(jquery)