我想設置倒計時到1月1日2017年。但刷新頁面時,倒計時復位,並開始24天后再次計數23小時50分鐘.. check the image時間重置jQuery的優雅倒計時刷新頁面時
$(document).ready(function() {
$('#countdown4').ClassyCountdown({
end: $.now() + 2160000,
labels: true,
style: {
element: "",
textResponsive: .5,
days: {
gauge: {
thickness: .03,
bgColor: "rgba(255,255,255,0.05)",
fgColor: "#1abc9c"
},
textCSS: 'font-family:\'Open Sans\'; font-size:25px; font-weight:300; color:#fff;'
},
hours: {
gauge: {
thickness: .03,
bgColor: "rgba(255,255,255,0.05)",
fgColor: "#2980b9"
},
textCSS: 'font-family:\'Open Sans\'; font-size:25px; font-weight:300; color:#fff;'
},
minutes: {
gauge: {
thickness: .03,
bgColor: "rgba(255,255,255,0.05)",
fgColor: "#8e44ad"
},
textCSS: 'font-family:\'Open Sans\'; font-size:25px; font-weight:300; color:#fff;'
},
seconds: {
gauge: {
thickness: .03,
bgColor: "rgba(255,255,255,0.05)",
fgColor: "#f39c12"
},
textCSS: 'font-family:\'Open Sans\'; font-size:25px; font-weight:300; color:#fff;'
}
},
onEndCallback: function() {
console.log("Time out!");
}
});
});
檢查代碼中,我使用
,你可以分享你什麼嘗試? –
我不知道你想要什麼。你爲什麼要倒數到2016年1月1日 - 這是過去。你的結局總是從現在起25天:end:$ .now()+ 2160000 - 請告訴我們,你到底想要什麼。 – Seb
對不起,coutdown日期是2017年1月1日 –