Fork me on github

简单的点击短信发送计时器

 

简单的点击短信发送计时器



<input type="button" id="btn" value="发送短信">
<script type="text/javascript"  src="/jquery/jquery.js">
    var count_time= 60;//定义规定的时间,60秒后再次发送
    function start_timer()
    {
         
        if(count_time == 0)
        {
            $('#btn').removeAttr("disabled");
            $('#btn').val("重新发送");
            count_time= 60;
        }else
        {
            $('#btn').attr("disabled",true);
            $('#btn').val("重新发送("+count_time+")");
            count_time--;
            setTimeout(function(){start_timer();},1000);
        }
 
    }
 
    $('#btn').click(function(){
        start_timer();
    });
</script>

 

posted @ 2015-09-25 10:59  Champion-水龙果  阅读(334)  评论(0编辑  收藏  举报
Champion-水龙果