헤드부분에 2022 수능 카운트다운 기능넣기 정보
헤드부분에 2022 수능 카운트다운 기능넣기관련링크
첨부파일
본문
처음 접속화면 맨 윗부분에 2022 수능 카운트다운 기능을 넣어보았습니다.
head.php 에 다음 코드를 붙여넣기 하시면 됩니다.
필요한 부분에 넣으시면 잘 되리라 봅니다.
자세한 내용은 첨부한 메모장을 참고해주세요.
감사합니다
<head.php>
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if (G5_IS_MOBILE) {
include_once(G5_THEME_MOBILE_PATH.'/head.php');
return;
}
if(G5_COMMUNITY_USE === false) {
define('G5_IS_COMMUNITY_PAGE', true);
include_once(G5_THEME_SHOP_PATH.'/shop.head.php');
return;
}
include_once(G5_THEME_PATH.'/head.sub.php');
include_once(G5_LIB_PATH.'/latest.lib.php');
include_once(G5_LIB_PATH.'/outlogin.lib.php');
include_once(G5_LIB_PATH.'/poll.lib.php');
include_once(G5_LIB_PATH.'/visit.lib.php');
include_once(G5_LIB_PATH.'/connect.lib.php');
include_once(G5_LIB_PATH.'/popular.lib.php');
?>
<!-- 상단 시작 { -->
<div id="hd">
<h1 id="hd_h1"><?php echo $g5['title'] ?></h1>
<div id="skip_to_container"><a href="#container">본문 바로가기</a></div>
<?php
if(defined('_INDEX_')) { // index에서만 실행
include G5_BBS_PATH.'/newwin.inc.php'; // 팝업레이어
}
?>
<div id="tnb">
<div class="inner">
<?php if(G5_COMMUNITY_USE) { ?>
<ul id="hd_define">
<li class="active"><a href="<?php echo G5_URL ?>/">커뮤니티</a></li>
<li><a href="<?php echo G5_SHOP_URL ?>/">쇼핑몰</a></li>
</ul>
<?php } ?>
<!-- 카운트다운 기능넣기 시작 2021.6.4-->
<style>
#demo {
color: yellow;
font-size: 17px;
margin-top: 0px;
float:left;
padding-top: 8px; padding-left: 30px;
}
</style>
<p id="demo"></p>
<script>
// Set the date we're counting down to
var countDownDate = new Date("Nov 18, 2021 08:10:00").getTime();
// Update the count down every 1 second
var x = setInterval(function() {
// Get today's date and time
var now = new Date().getTime();
// Find the distance between now and the count down date
var distance = countDownDate - now;
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Output the result in an element with id="demo"
document.getElementById("demo").innerHTML ="2022수능 : "+ " -"+ days + "일 " + hours + "시간 "
+ minutes + "분 " + seconds + "초 ";
// If the count down is over, write some text
if (distance < 0) {
clearInterval(x);
document.getElementById("demo").innerHTML = "EXPIRED";
}
}, 1000);
</script>
<!-- 카운트다운 기능넣기 끝 2021.6.4-->
3