남은시간 카운트 : 2022-12-25-13:30:00
페이지 정보
작성자 비타주리 작성일 22-05-11 12:37 조회 5,482 댓글 0본문
<link href=https://fonts.googleapis.com/css2?family=Lato&display=swap rel=stylesheet>
<style>
#countSpan { font-family:Lato; font-weight:bold; font-size:3rem; }
#countSpan span { font-size:2rem; }
</style>
<script>
targetTime = "2022-12-25-13:30:00";
document.write("<div style=text-align:center;padding-top:20px><span id=countSpan></span></div>");
targetCount = targetTime.split("-")[1] + "-" + targetTime.split("-")[2] + "-" + targetTime.split("-")[0] + "-" + targetTime.split("-")[3];
function countInterval() {
countTime = new Date(targetCount) - new Date();
countDay = Math.floor(countTime / (1000 * 60 * 60 * 24)) < 1 ? "" : Math.floor(countTime / (1000 * 60 * 60 * 24)) + "<span>일</span> ";
countHour = ("0" + Math.floor(countTime % (1000 * 60 * 60 * 24) / (1000 * 60 * 60))).slice(-2) + ":";
countMinute = ("0" + Math.floor(countTime % (1000 * 60 * 60) / (1000 * 60))).slice(-2) + ":";
countSecond = ("0" + Math.floor(countTime % (1000 * 60) / 1000)).slice(-2);
if (countTime < 1) {
countSpan.innerHTML = "이벤트 종료";
clearInterval(countMode);
}
else countSpan.innerHTML = countDay + countHour + countMinute + countSecond;
}
countInterval();
countMode = setInterval(countInterval, 1000);
</script>
<style>
#countSpan { font-family:Lato; font-weight:bold; font-size:3rem; }
#countSpan span { font-size:2rem; }
</style>
<script>
targetTime = "2022-12-25-13:30:00";
document.write("<div style=text-align:center;padding-top:20px><span id=countSpan></span></div>");
targetCount = targetTime.split("-")[1] + "-" + targetTime.split("-")[2] + "-" + targetTime.split("-")[0] + "-" + targetTime.split("-")[3];
function countInterval() {
countTime = new Date(targetCount) - new Date();
countDay = Math.floor(countTime / (1000 * 60 * 60 * 24)) < 1 ? "" : Math.floor(countTime / (1000 * 60 * 60 * 24)) + "<span>일</span> ";
countHour = ("0" + Math.floor(countTime % (1000 * 60 * 60 * 24) / (1000 * 60 * 60))).slice(-2) + ":";
countMinute = ("0" + Math.floor(countTime % (1000 * 60 * 60) / (1000 * 60))).slice(-2) + ":";
countSecond = ("0" + Math.floor(countTime % (1000 * 60) / 1000)).slice(-2);
if (countTime < 1) {
countSpan.innerHTML = "이벤트 종료";
clearInterval(countMode);
}
else countSpan.innerHTML = countDay + countHour + countMinute + countSecond;
}
countInterval();
countMode = setInterval(countInterval, 1000);
</script>
댓글목록 0
등록된 댓글이 없습니다.