<head runat="server">
<title></title>
<script src="Js/jquery-1.10.2.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
});
var interval;
function fInterval() {
var currTime = (new Date()).valueOf();
var diftime = currTime - parseInt($("#AcceptTime").val(), 10);
if (diftime < 5 * 1000) {
//隐藏按钮
$("#GetMsg").attr("style", "display:none");
$("#timeTip").attr("style", "display:block");
$("#timeTip").html("请在" + Math.floor((5 * 1000 - diftime) / 1000) + "秒后重新获取验证码!");
return;
}
else {
if (interval != null) {
clearInterval(interval);
}
$("#GetMsg").attr("style", "display:block");
$("#timeTip").attr("style", "display:none");
}
}
function SentCaptcha() {
$("#AcceptTime").val((new Date()).valueOf());
interval = setInterval(fInterval, 1000);
}
</script>
</head>
<body>
<div>
<input type="button" id="GetMsg" value="获取验证码" οnclick="SentCaptcha()" style="display:block;" />
<div id="timeTip" style="display: none;"> </div>
<input type="hidden" id="AcceptTime" />
</div>
</body>