zoukankan      html  css  js  c++  java
  • 倒计时

    // 点击“获取验证码”
    $("#getCode").click(function(){
    if(!($("#getCode").hasClass("yes"))) {
    var count=60; // 60s秒获取验证码
    var phoneNum = $("#phoneN").val();
    if(!phoneNum){
    PopupCreate({
    cont: "请输入移动号码!",
    cueYes: "确定",
    btYes: null,
    sClass: "duihao",
    hideNo: true
    });
    return;
    }
    if(phoneNum.length!=11){
    PopupCreate({
    cont: "请输入11位的移动号码",
    cueYes: "确定",
    btYes: null,
    sClass: "duihao",
    hideNo: true
    });
    return;
    }
    if(!(/^1(3[4-9]|5[012789]|8[23478]|47|78)d{8}$/.test(phoneNum))){
    PopupCreate({
    cont: "对不起,此次活动仅限移动用户参加!",
    cueYes: "确定",
    btYes: null,
    sClass: "duihao",
    hideNo: true
    });
    }else{
    $("#getCode").addClass("yes");
    $("#getCode").html(count+"秒后重发");
    queryCode(phoneNum); // 请求手机验证码
    countDown=window.setInterval(setTimer, 1000);
    }

    //定时器
    function setTimer() {
    var sendBt = $("#getCode");
    sendBt.addClass("yes");
    if (count == 1) {
    window.clearInterval(countDown);
    sendBt.removeAttr("disabled");
    sendBt.removeClass("yes");
    sendBt.html("获取验证码");
    } else {
    count--;
    sendBt.html(count+"秒后重发");
    }
    }
    }else{ return; }

    });

  • 相关阅读:
    matplotlib基础
    numpy基础
    池化层的前向计算
    卷积神经网络应用于MNIST数据集分类
    用tensorflow的Eager执行模式
    tensorboard网络结构
    优化器
    交叉熵
    [webpack]——loader配置
    [webpack]--webpack 如何解析代码模块路径
  • 原文地址:https://www.cnblogs.com/ey-151210/p/5772760.html
Copyright © 2011-2022 走看看