헤드부분에 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-->
댓글 2개
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4443 | ||
| 2544 | 1년 전 | 947 | ||
| 2543 | 1년 전 | 847 | ||
| 2542 | 1년 전 | 748 | ||
| 2541 | 1년 전 | 777 | ||
| 2540 | 1년 전 | 1189 | ||
| 2539 | 1년 전 | 1024 | ||
| 2538 | 1년 전 | 1009 | ||
| 2537 |
|
1년 전 | 845 | |
| 2536 | 1년 전 | 1229 | ||
| 2535 |
|
1년 전 | 785 | |
| 2534 |
|
1년 전 | 892 | |
| 2533 |
거북이와두루미
|
1년 전 | 1666 | |
| 2532 | 1년 전 | 801 | ||
| 2531 | 1년 전 | 678 | ||
| 2530 | 1년 전 | 722 | ||
| 2529 | 1년 전 | 1068 | ||
| 2528 |
|
1년 전 | 558 | |
| 2527 | 1년 전 | 1139 | ||
| 2526 | 1년 전 | 750 | ||
| 2525 | 1년 전 | 1114 | ||
| 2524 | 1년 전 | 916 | ||
| 2523 | 1년 전 | 1341 | ||
| 2522 | 1년 전 | 961 | ||
| 2521 | 1년 전 | 1314 | ||
| 2520 | 1년 전 | 1192 | ||
| 2519 | 1년 전 | 1066 | ||
| 2518 |
Lemios
|
1년 전 | 873 | |
| 2517 | 1년 전 | 958 | ||
| 2516 | 1년 전 | 1707 | ||
| 2515 | 1년 전 | 851 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기