16,874
个编辑
LLWiki正在建设中,欢迎加入我们!
小 |
小 |
||
hour = isBefore ? now.getHours() - then.getHours() : then.getHours() - now.getHours(),
minute = isBefore ? now.getMinutes() - then.getMinutes() : then.getMinutes() - now.getMinutes(),
second = isBefore ? now.getSeconds() - then.getSeconds() : then.getSeconds() - now.getSeconds(),
result = "";
if (second < 0) {
else if (result !== "") { result += `<span class="countdown-num">0</${"span"}><span class="countdown-hour"></${"span"}>`; }
if(day == 0) {
if (minute > 0) { result += `<span class="countdown-num">${minute}</${"span"}>分
else if (result !== "") { result += `<span class="countdown-num">0</${"span"}>分
if (second > 0) { result += `<span class="countdown-num">${second}</${"span"}>秒
else if (result !== "") { result += `<span class="countdown-num">0</${"span"}>秒
}
}
|