首页 > Web开发 > 详细

jQuery 发送验证码倒计时按钮 复制代码

时间:2014-11-05 16:19:33      阅读:259      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script src="../scripts/jquery.js" type="text/javascript"></script>
    <script>
        $(function () {
            var util = {
                wait: 90,
                hsTime: function (that) {
                    _this = $(this);
                    if (_this.wait == 0) {
                        $(‘#hsbtn‘).removeAttr("disabled").val(‘重发短信验证码‘);
                        _this.wait = 90;
                    } else {
                        var _this = this;
                        $(that).attr("disabled", true).val(‘在‘ + _this.wait + ‘秒后点此重发‘);
                        _this.wait--;
                        setTimeout(function () {
                            _this.hsTime(that);
                        }, 1000)
                    }
                }
            }
            util.hsTime(‘#hsbtn‘);
            $("#hsbtn").click(function(){
                util.hsTime(‘#hsbtn‘);
            })
        })
    </script>
</head>
<body>
<input type="button" id="hsbtn" />
</body>
</html>

 

jQuery 发送验证码倒计时按钮 复制代码

原文:http://www.cnblogs.com/sntetwt/p/4076389.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!