HTML
<span id="hms_timer"></span>
<button onclick="resetime()">Reset time for 3hr</button>
Javasript
//Default countdown will start from 2 hour
$('#hms_timer').countdowntimer({
hours: 2,
minutes: 0,
seconds: 0,
size: "lg"
});
//Onclick button reset previous countdown
function resetime(){
$('#hms_timer').countdowntimer({
hours: 3,
minutes: 0,
seconds: 0,
size: "lg"
});
}
我使用过ref link http://harshen.github.io/jquery-countdownTimer
这里2小时设置了coutdown timer的默认值。但是当我点击按钮(计时器成功设置为3小时)然后计数器因为超时而快速运行。你能帮我吗? 提前谢谢。