<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<!-- 为移动设备添加 viewport -->
<meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<!-- 添加到主屏后的标题(iOS 6 新增) -->
<meta name="apple-mobile-web-app-title" content="">
<meta name="format-detection" content="telephone=no">
<!-- 是否启用 WebApp 全屏模式,删除苹果默认的工具栏和菜单栏 -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>手机注册</title>
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
</head>
<body>
<button class="getVerificationCode" type="button">获取验证码</button>
</body>
</html>
<script type="text/javascript">
$(function () {
var send=$(".getVerificationCode"),timer=null,wait=60;
function time() {
if (wait == 0) {
send.prop("disabled",false);
send.text("获取动态码");
send.css({background:"#9cc829"});
clearTimeout(timer);
timer=null;
wait=60;
} else {
send.prop("disabled", true);
send.text("重新发送(" + wait + ")");
send.css({background:"#a5a5a5"});
wait--;
timer=setTimeout(time, 1000);
}
}
time();
//点击下一步---提示验证错误
$(".buttonClick").click(function () {
// utils.error("验证码输入错误");
});
});
</script>
//时分秒倒计时
//不足两位补0
function timeS(num) {
return ('0' + num).slice(-2);
}
function moveTime() {
var starttime = $(".w_sp2").attr("starttime").replace(/-/g, '/');
var endtime = $(".w_sp2").attr("endtime").replace(/-/g, '/'); //苹果浏览器不识别new Date('2013-10-21'),只识别new Date('2013/10/21');
var startTime = new Date(starttime).getTime();
var endTime = new Date(endtime).getTime();
var differTime = endTime - startTime; //两时间差
function FreshTime() {
var d = parseInt(differTime / (24 * 60 * 60 * 1000));
var h = parseInt(differTime / (60 * 60 * 1000) % 24);
var m = parseInt(differTime / (60 * 1000) % 60);
var s = parseInt(differTime / 1000 % 60);
var t_html = d + "天" + timeS(h) + "时" + timeS(m) + "分" + timeS(s) + "秒";
$(".w_sp2").html(t_html);
if (differTime <= 0) {
$(".w_sp2").html('当前价格已失效');
$(".i_contThr").hide()
clearInterval(timer);
}
differTime = differTime - 1000;
}
FreshTime();
var timer = setInterval(FreshTime, 1000);
}