/*****************************************************************
deletion of the current branch prohibited
powered by nnin ( http://www.nnin.com )
*****************************************************************/
/*jslint browser: true*/
/*global $, jQuery*/
$(function () {
/* ìƒë‹¨ë©”ë‰´ê´€ë ¨ */
var gnb = $('.gnb');
var gnbHeight = $(gnb).height();
var topArea = $('.topArea');
var topAreaHeight = topArea.length ? topArea.height() : 0;
var headerHeight = gnbHeight;
$('#header').height(headerHeight); // headerì˜ ë†’ì´ë¥¼ ê³„ì‚°ëœ ê°’ìœ¼ë¡œ ì„¤ì •
$(window).scroll(function () {
var scrollTop = $(this).scrollTop(); // 현재 스í¬ë¡¤ 위치를 ì €ìž¥í•©ë‹ˆë‹¤.
var gnbTop = topArea.length ? gnb.offset().top : 0; // gnb ìš”ì†Œì˜ ìƒë‹¨ 위치를 ì €ìž¥í•©ë‹ˆë‹¤.
var topAreaTop = topArea.length ? topArea.offset().top : 0; // topArea ìš”ì†Œì˜ ìƒë‹¨ 위치를 ì €ìž¥í•©ë‹ˆë‹¤.
var gnbOffsetFromTopArea = gnbTop - topAreaTop; // gnb 요소가 topArea로부터 얼마나 ë–¨ì–´ì ¸ 있는지 계산합니다.
if (scrollTop > gnbHeight - 10) {
var newPosition = gnbOffsetFromTopArea - topAreaHeight; // 새로운 위치를 계산합니다.
gnb.addClass('on').css('top', newPosition + 'px'); // gnbì— 'on' í´ëž˜ìŠ¤ë¥¼ ì¶”ê°€í•˜ê³ , 새로운 위치를 ì 용합니다.
} else {
gnb.removeClass('on').css('top', ''); // ê·¸ë ‡ì§€ 않으면 'on' í´ëž˜ìŠ¤ë¥¼ ì œê±°í•˜ê³ , 위치를 초기화합니다.
}
});
function scrollFixed() {
var scrollTop = $(this).scrollTop();
var gnbTop = topArea.length ? gnb.offset().top : 0;
var topAreaTop = topArea.length ? topArea.offset().top : 0;
var gnbOffsetFromTopArea = gnbTop - topAreaTop;
if (scrollTop > gnbHeight - 10) {
var newPosition = gnbOffsetFromTopArea - topAreaHeight;
gnb.addClass('on').css('top', newPosition + 'px');
} else {
gnb.removeClass('on').css('top', '');
}
}
scrollFixed();
/* ìƒë‹¨ë©”뉴 : 모바ì¼ì—서 하위메뉴 펼치기 */
$('ul.dropdown-menu [data-toggle=dropdown]').on('click', function (event) {
event.preventDefault();
event.stopPropagation();
$(this).parent().siblings().removeClass('open');
$(this).parent().toggleClass('open');
});
/**/
$('.nt_quick').on({
mouseover: function () {
$(this).find('ul').stop().slideDown(200);
},
mouseout: function () {
$(this).find('ul').stop().slideUp(400);
}
});
/**/
$('.nt_project').on({
mouseover: function () {
$(this).find('ul').stop().slideDown(200);
},
mouseout: function () {
$(this).find('ul').stop().slideUp(400);
},
click: function () {
$(this).toggleClass('s_on');
if ($(this).hasClass('s_on')) {
$(this).find('ul').slideDown();
} else {
$(this).find('ul').slideUp();
}
}
});
/* scrolltop */
$(window).scroll(function () {
if ($(this).scrollTop() > 200) {
$('.scrollToTop').fadeIn();
} else {
$('.scrollToTop').fadeOut();
}
});
$('.scrollToTop').click(function () {
$('html, body').animate({
scrollTop: 0
}, 800);
return false;
});
/* íˆ´íŒ */
$(function () {
$('[data-toggle="tooltip"]').tooltip();
});
/* ì´ë¯¸ì§€ 확대,축소 */
$('.scaleUp').on({
mouseover: function () {
$(this).addClass('on');
},
mouseout: function () {
$(this).removeClass('on');
}
});
$('.scaleDown').on({
mouseover: function () {
$(this).addClass('on');
},
mouseout: function () {
$(this).removeClass('on');
}
});
/* 효과01 */
$('.effect01').each(function () {
$(this).on({
mouseenter: function () {
$(this).find('.effect01-box').stop().animate({
bottom: 0,
opacity: 1
}, 200);
},
mouseleave: function () {
$(this).find('.effect01-box').stop().animate({
bottom: -50,
opacity: 0
}, 200);
}
});
$(this).css({
cursor: 'pointer'
});
});
/* 효과02 */
$('.effect02').each(function () {
$(this).on({
mouseenter: function () {
$('.effect02-box').stop().animate({
top: 20,
opacity: 0.2
}, 100);
$(this).find('.effect02-box').stop().animate({
top: 0,
opacity: 1.0
}, 200);
},
mouseleave: function () {
$('.effect02-box').stop().animate({
top: 10,
opacity: 0.8
}, 100);
$(this).find('.effect02-box').stop().animate({
top: 10,
opacity: 0.8
}, 200);
}
});
$(this).css({
cursor: 'pointer'
});
});
/* 효과03 */
$('.effect03').each(function () {
$(this).on({
mouseenter: function () {
$(this).find('.effect03-box').stop().animate({
top: '50%',
opacity: 1
}, 200);
},
mouseleave: function () {
$(this).find('.effect03-box').stop().animate({
top: '40%',
opacity: 0
}, 200);
}
});
$(this).css({
cursor: 'pointer'
});
});
/* map ì§€ë„ : êµ¬ê¸€ì§€ë„ */
$('.map_google').click(function () {
$(this).find('iframe').addClass('clicked');
}).mouseleave(function () {
$(this).find('iframe').removeClass('clicked');
});
/*****************************************************************
- 아래 ì œíœ´ì‚¬ 활성화는, ë””ìžì¸ë‹Œì˜ 추가서비스를 ì´ìš© 하실 수 있습니다.
*****************************************************************/
$('.n_copyright').append(' powered by nnin');
$('.n_copyright span').css({
display: 'inline-block'
// marginBottom: '5px'
});
$('.n_copyright span a').attr('target', '_blank');
/************************************************************
게시íŒ
************************************************************/
/*게시íŒ:공통*/
$('.n_board_txt, .n_board_gallery').find('table[border="1"]').attr('border', '0');
/* ì¹´í…Œê³ ë¦¬ > ì…€ë ‰íŠ¸ë°•ìŠ¤ : ì†ì„± 변경 ****************************************/
$('form[name=com_board_form]').parent().addClass('categoryArea');
$('form[name=com_board_form]').parent().find('td').removeAttr('align');
// $('form[name=com_board_form]').parent().css('marginBottom', '5px');
// $('form[name=com_board_form]').parent().find('img').remove();
// $('form[name=com_board_form]').parent().find('td > b').remove();
/* ì¹´í…Œê³ ë¦¬ > íƒë²„튼형 : ì†ì„± 변경(í°íЏí¬ê¸°) */
$('.sul_menu').parent('td').find('font').removeAttr('style', '');
$('.sul_menu img').next('a').addClass('on');
/* 댓글ì˜ì— ***********************************************/
/* 댓글ì˜ì— : 작성 */
$('.board_comment_bgcolor tbody:not(:first-child)').css({
'border': '0px solid #f00',
'padding': '0 10px',
'display': 'block'
});
/* 댓글ì˜ì— : 작성ì˜ì— */
$('.comment_txt > textarea').css({
'margin': '0 0 5px',
'padding': '10px',
'border': '1px solid #ccc',
'height': '100px'
});
/* 댓글ì˜ì— : 작성ì˜ì— : 버튼(댓글달기) */
$('.comment_txt > input[type=image]').css({
'paddingRight': '10px',
'float': 'left'
});
/* 댓글ì˜ì— : ëŒ“ê¸€ëª©ë¡ */
$('.comment_name').parent('tr').children('td').removeAttr('width');
$('.comment_name').parent('tr').children('td:nth-child(2)').addClass('comment_view');
$('.comment_name').parent('tr').children('td:nth-child(3)').addClass('comment_hour');
$('.comment_name').parent().parent().parent().parent().parent().parent().parent().addClass('commentArea');
/* í…스트형 : ê¸€ëª©ë¡ : 최ìƒë‹¨ ë¼ì¸ì˜ì— */
$('.n_board_txt .bbsno').parents('table').prev().find('td').addClass('board_top_line');
/* í…스트형 : ê¸€ëª©ë¡ 'tr' ì„ íƒ*/
$('.n_board_txt .bbsno').parent('tr').addClass('tr_line');
/* í…스트형 : ê¸€ëª©ë¡ : 최ìƒë‹¨ 구분ì˜ì— */
$('.n_board_txt .att_title').parent('tr').addClass('boardTitBar');
/* í…스트형 : ê¸€ëª©ë¡ : 최ìƒë‹¨ í–‰ ì†ì„± */
$('.n_board_txt .att_title font').removeAttr('style');
/* í…스트형, 갤러리형, 웹진형 : 글보기 / 글쓰기*/
$('.n_board_txt .board_bgcolor, .n_board_gallery .board_bgcolor, .n_board_webzine .board_bgcolor').parent('tr').addClass('diviedLine');
/* í…스트형 : 목ë¡ì „ì²´ì˜ì— : 하단여백*/
$('.boardTitBar').parent().parent().css('marginBottom', '20px');
/* 공통 : ëª©ë¡ : 하단 ì˜ì—들 */
$('.paging').css('padding', '10px 0');
$('.paging').parent().parent().parent().prev().css('border', '1px solid #fff');
$('.paging').parent('tr').next().remove();
// ê°¤ëŸ¬ë¦¬ëª©ë¡ : 관리ìžë¡œê·¸ì¸ì‹œ 게시물체í¬ë°•스
$('.n_board_gallery').find('input[name=delete_check_notice\\[\\]]').parent('td').addClass('adminCheck');
$('.n_board_gallery').find('input[name=delete_check_notice\\[\\]]').addClass('adminCheckBox');
// ê°¤ëŸ¬ë¦¬ëª©ë¡ : ì´ë¯¸ì§€ì„ íƒ(ì œëª©ì„ ì‚¬ìš©í•´ì•¼ ë¨)
$('.gallery_subject').parent().siblings('tr:first-child').addClass('nSize');
// ê°¤ëŸ¬ë¦¬ëª©ë¡ : 사ì´ì¦ˆ
$('.nSize').parents('.bbsnewf5').parents('td').addClass('boxArea');
// í…스트 ë‚´ìš©
$('.gallery_etc').css('color', '#fff');
/* í¼ë©”ì¼ : í•ëª©ì˜ ì†ì„± ì œê±° ***********************************************/
$('.formmail_title_bgcolor font').removeAttr('style');
/* ê°œì¸ì •ë³´ 수집ë™ì˜ ì˜ì— */
$('.np_form input[name=com_formmail_check_safe]').closest('table').addClass('personalInformation');
/* 스팸등ë¡ë°©ì§€ ì˜ì— */
$('#captcha').closest('tr').addClass('captcha');
/* í¼ë©”ì¼ : 하단버튼ì˜ì— : ìƒë‹¨ì—¬ë°± */
$('a[href="javascript: document.com_formmail.reset();"]').parent().addClass('formButton');
/* í¼ë©”ì¼ : 하단버튼ì˜ì— : 버튼 : í™•ì¸ */
$('.formButton a:first-child img').attr('src', '../img/component/board/board_1/confirm.gif');
/* í¼ë©”ì¼ : 하단버튼ì˜ì— : 버튼 : 취소 */
$('.formButton a:last-child img').attr('src', '../img/component/board/board_1/cancel.gif');
/* 글쓰기 : 하단버튼ì˜ì—ì˜ ìƒë‹¨ì—¬ë°± */
$('a[href="javascript: document.com_board.reset()"]').parent().parent().parent().parent().addClass('nbButton');
$('a[href="javascript: history.back()"]').parent().parent().parent().parent().addClass('nbButton');
/* 글보기 : 하단버튼ì˜ì— */
$('img[align=absmiddle]').closest('table').parent().parent().parent().parent().addClass('veiwBottonArea');
/* 글목ë¡,글보기 : 하단ë¼ì¸ & 글목ë¡ë¦¬ìŠ¤íŠ¸ */
$('.veiwBottonArea').siblings('table:last').find('td').css('backgroundColor', '#fff');
/* ê¸€ëª©ë¡ : 하단 버튼 */
$('img[src="/cimg/btn_sdel.gif"]').attr('src', '../img/component/board/board_1/admin_delete.gif');
$('img[src="/cimg/move.gif"]').attr('src', '../img/component/board/board_1/admin_move.gif');
$('img[src="/cimg/copy.gif"]').attr('src', '../img/component/board/board_1/admin_copy.gif');
/* 글쓰기 : 취소버튼 (뒤로가기) */
$('a[href="javascript: document.com_board.reset()"]').attr('href', 'javascript:window.history.back();');
/*****************************************************************
ì¼ì •관리
*****************************************************************/
$('.np_schedule table').attr('width', '100%');
$('.np_schedule').find('input[name=subject]').attr('size', '').css('width', '100%');
/*****************************************************************
쇼핑몰 : 페ì´ì§•
*****************************************************************/
$('.tb_font04').parent().siblings('td[width=1]').remove();
/*****************************************************************
í¼ë©”ì¼ ê³µë°±ì œê±°
*****************************************************************/
// $('.np_form td').each(function () {
// $(this).html($(this).html().replace(/ /gi, ''));
// });
});
/*****************************************************************
des : ë””ìžì¸ëª¨ë“ˆ
*****************************************************************/
/* de01 */
var nSwiper01 = new Swiper(".de01 .mySwiper", {
speed: 1200,
keyboard: {
enabled: true,
},
autoplay: {
delay: 4500,
disableOnInteraction: false,
},
hashNavigation: {
watchState: true,
},
parallax: true,
grabCursor: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
loop: true
});
/* de02 */
var nSwiper02 = new Swiper('.de02 .mySwiper', {
speed: 1200,
autoplay: {
delay: 4500,
disableOnInteraction: false,
},
parallax: true,
grabCursor: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
loop: true
});
/* de03 */
var nSwiper03 = new Swiper('.de03 .mySwiper', {
speed: 1200,
slidesPerView: 1,
spaceBetween: 10,
// centeredSlides: true,
grabCursor: true,
autoplay: {
delay: 3000,
disableOnInteraction: false,
},
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
breakpoints: {
640: {
slidesPerView: 1,
spaceBetween: 10,
},
768: {
slidesPerView: 2,
spaceBetween: 20,
},
1024: {
slidesPerView: 3,
spaceBetween: 30,
},
1300: {
slidesPerView: 4,
spaceBetween: 40,
},
1920: {
slidesPerView: 5,
spaceBetween: 50,
},
},
loop: true
});
/* de09 : ë©”ì¸íŽ˜ì´ì§€ì—서 6단진열 */
$(function () {
$('.ms_de09 .de09 > .row > div').addClass('col-lg-2');
});
/* de24 : 모달/ì¸íŠ¸ë¡œ/ë ˆì´ì–´ íŒì—… */
$(function () {
/**/
$('.de24 .nOpen_popup').modal({
keyboard: true,
show: false /* true, false */
});
$('.modal-dialog').draggable({
handle: ".modal-header_nOpen_popup"
});
$('.de24 .nOpen_popup').on('hidden.bs.modal', function () {
var iframe = $(this).find('iframe');
var videoSrc = iframe.attr('src');
iframe.attr('src', '');
iframe.attr('src', videoSrc);
});
/**/
var nSwiper24 = new Swiper('.de24 .mySwiper', {
speed: 1000,
keyboard: {
enabled: true,
},
autoHeight: true,
autoplay: {
delay: 4500,
disableOnInteraction: false,
},
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
loop: true
});
});
/* de40 : 하루닫기 íŒì—… */
// Function to show the pop-up and overlay
function showPopup() {
var overlay = document.getElementById('overlay');
var popup = document.getElementById('popup');
if (overlay && popup) {
overlay.style.display = 'block';
popup.style.display = 'block';
}
}
// Function to close the pop-up and overlay
function closePopup() {
var overlay = document.getElementById('overlay');
var popup = document.getElementById('popup');
if (overlay && popup) {
overlay.style.display = 'none';
popup.style.display = 'none';
}
}
// Function to hide the pop-up for 24 hours
function hideFor24Hours() {
// Set a cookie with a 24-hour expiration
const now = new Date();
const expiryDate = new Date(now.getTime() + 24 * 60 * 60 * 1000); // 24 hours in milliseconds
document.cookie = 'popup_hidden=true; expires=' + expiryDate.toUTCString() + '; path=/';
closePopup(); // Close the pop-up
}
// Function to check if the pop-up should be shown
function checkPopup() {
var overlay = document.getElementById('overlay');
var popup = document.getElementById('popup');
if (overlay && popup && document.cookie.indexOf('popup_hidden=true') === -1) {
showPopup();
}
}
// Check if the pop-up should be shown when the page loads
checkPopup();
// Function to close pop-up when clicking outside of it
window.addEventListener('click', function (event) {
var popup = document.getElementById('popup');
if (popup && !popup.contains(event.target)) {
closePopup();
}
});
/*****************************************************************
AOS Animate on scroll
*****************************************************************/
// AOS 기본값
AOS.init({
duration: 1200
});
/*****************************************************************
서브페ì´ì§€ > ìƒë‹¨ì´ë¯¸ì§€ > í…스트 효과
*****************************************************************/
// 페ì´ì§€ê°€ 로드ë 때 실행ë˜ëŠ” 함수
window.onload = function() {
// h3 요소 ì„ íƒ í›„ í´ëž˜ìФ 추가
var h3Element = document.querySelector('.nt_imgArea .con h3');
h3Element.classList.add('animate__animated', 'animate__fadeInUp');
// p 요소 ì„ íƒ í›„ í´ëž˜ìФ 추가
var pElement = document.querySelector('.nt_imgArea .con p');
pElement.classList.add('animate__animated', 'animate__fadeInDown');
};
/*****************************************************************
******************************************************************
end
******************************************************************
*****************************************************************/