$(function(){ $(".register-title li").click(function(){ var index=$(this).index(); console.log(index,222); $(".register-title li").removeClass('active'); $(this).addClass('active'); $(".register-dialog-ul li").removeClass('active') $(".register-dialog-ul>li").eq(index).addClass('active'); }) $('#getCode').click(function(){ var obj = this; $.post("ajax/sms.php",{tel:$('#tel').val(),yzm:$('#form-authcode').val()},function(dt){ alert(dt.msg); if(dt.status==1){ settime($(obj)); }else{ $('.img-code').click(); } },'json'); return false; }); $('.ajaxFormSubmit').ajaxForm({ dataType: 'json', success: function(data) { if(data.status == 1){ alert(" 请您耐心等待,我们会在第一时间为您安排在线体验"); window._agl && window._agl.push(['track', ['success', {t: 3}]]) window._agl && window._agl.push(['track', ['success', {t: 18}]]) }else{ alert(data.msg); } } }); var countdown=60; function settime(obj) { if (countdown == 0) { obj.removeAttr("disabled"); obj.val("获取验证码"); obj.css('background-color',''); countdown = 60; return; } else { obj.attr("disabled", true); obj.val("重新发送(" + countdown + ")"); obj.css('background-color','#e45050'); countdown--; } setTimeout(function() { settime(obj) } ,1000) } $(".yf-intro-show .close").click(function(){ $(".yf-intro-show").hide(500); }) });