Compare commits
No commits in common. 'master' and '1.0.1' have entirely different histories.
@ -0,0 +1 @@
|
|||||||
|
# test
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
//计时器
|
||||||
|
var intDiff = parseInt(15);//倒计时总秒数量
|
||||||
|
function timer(intDiff) {
|
||||||
|
window.setInterval(function () {
|
||||||
|
var minute = 0,
|
||||||
|
second = 0;//时间默认值
|
||||||
|
if (intDiff > 0) {
|
||||||
|
minute = Math.floor(intDiff / 60);
|
||||||
|
second = Math.floor(intDiff) - (minute * 60);
|
||||||
|
}
|
||||||
|
if (minute <= 9) minute = '0' + minute;
|
||||||
|
if (second <= 9) second = '0' + second;
|
||||||
|
$('#minute').html('<s></s>' + minute + '分');
|
||||||
|
$('#second').html('<s></s>' + second + '秒');
|
||||||
|
intDiff++;
|
||||||
|
if (intDiff >= 20) {
|
||||||
|
clearInterval(timer); //定时器清除;
|
||||||
|
history.back(-1);
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
}
|
||||||
|
$(function () {
|
||||||
|
timer(intDiff);
|
||||||
|
});
|
||||||
Loading…
Reference in new issue