
兼容性:E 6, IE 7, IE 8, FF 3, Safari 4, Opera 9, Chrome 4
倒计时只需要设置结束时间即可。
可以同时多设置几个
例如:要在2017年1月10号11时00分00秒过期,页面直接就会显示剩余时间倒计时 targetDate: { 'day': 10, 'month': 1, 'year': 2017, 'hour': 11, 'min': 0, 'sec': 0 }
$('#countdown_dashboard').countDown({
targetDate: {
'day': 10,
'month': 1,
'year': 3037,
'hour': 11,
'min': 0,
'sec': 0,
'utc': true //按标准时间
},
onComplete: function() { alert(1) }, //回调
omitWeeks: true //不显示周
});
// Stop countdown
function stop() {
$('#countdown_dashboard').stopCountDown();
}
// Start countdown
function start() {
$('#countdown_dashboard').startCountDown();
}
// reset and start
function reset() {
$('#countdown_dashboard').stopCountDown();
$('#countdown_dashboard').setCountDown({
targetOffset: {
'day': 1,
'month': 1,
'year': 0,
'hour': 1,
'min': 1,
'sec': 1
}
});
$('#countdown_dashboard').startCountDown();
}