2차 퍼블 변경 분 반영

This commit is contained in:
KNKIM 2021-10-22 08:44:05 +09:00
parent 8e6f8fcabe
commit ea8b9ff88c

View File

@ -18,6 +18,278 @@ $(document).ready(function(){
} }
}); });
/* 인기자료 탭메뉴 */
(function ($) {
$('.tab ul.tabs').addClass('active').find('> li:eq(0)').addClass('current');
$('.tab ul.tabs li a').click(function (g) {
var tab = $(this).closest('.tab'),
index = $(this).closest('li').index();
tab.find('ul.tabs > li').removeClass('current');
$(this).closest('li').addClass('current');
tab.find('.tab_content').find('div.tabs_item').not('div.tabs_item:eq(' + index + ')').hide();
tab.find('.tab_content').find('div.tabs_item:eq(' + index + ')').show();
g.preventDefault();
});
})(jQuery);
/* 푸터 관련사이트 */
$(".family_site").click(function(){
$(this).toggleClass("on");
$(this) .find(".site_depth").slideToggle("fast");
});
/* 로그인 팝업 */
$(".login-btn").click(function(){
$(".pop-login").fadeIn();
});
$(".pop-login .login-close").click(function(){
$(".pop-login").fadeOut();
});
/* 로그인 연결 팝업 */
$(".login-connect-btn").click(function(){
$(".pop-login-connect").fadeIn();
});
$(".pop-login-connect .login-close").click(function(){
$(".pop-login-connect").fadeOut();
});
/* 로그인 연결 패스워드 팝업 */
$(".login-password-btn").click(function(){
$(".pop-login-password").fadeIn();
});
$(".pop-login-password .login-close").click(function(){
$(".pop-login-password").fadeOut();
});
// scroll top button
$(window).scroll(function() {
var $window = $(window);
var $document = $(document);
var $footer = $('#footer');
var $scrollBtn = $('#btn-go-top');
$scrollBtn.on('click', function () {
$("html, body").stop().animate({
scrollTop: 0
}, 600);
return false;
});
btnXPosition();
$window.resize(function () {
btnXPosition();
});
// top버튼 x좌표설정
function btnXPosition() {
var rightPosition = ($document.width() - 1756) / 2
// X position
if($document.width() > 1756) {
//$scrollBtn.css('right', rightPosition);
$scrollBtn.css('right', '25px');
} else {
$scrollBtn.css('right', '25px');
}
}
$window.on('scroll', function () {
if ($window.scrollTop() < $document.height() - $window.height() - $footer.outerHeight() + 37) {
$scrollBtn.addClass('go-top-fix');
} else {
$scrollBtn.removeClass('go-top-fix');
}
if ($window.scrollTop() < ($window.height() / 3)) {
$scrollBtn.addClass('go-top-hide');
} else {
$scrollBtn.removeClass('go-top-hide');
}
});
});
// 상세검색 팝업 - 문화원정보 선택영역 초기작업 메서드 분리
jQuery(function($) {
var depth2H = 0;
$('.pop-advanced-search .depth1-check input').each(function () {
if ($(this).is(":checked")) { // 활성화 line에 높이 잡아주기
$('.depth1').removeClass('on');
$(this).parents('.depth1').addClass('on');
depth2H = $(this).parents('.depth1-check').next('.depth2').outerHeight();
$(this).parents('.line').siblings('.line').attr('style', '');
$(this).parents('.line').height(depth2H + 50);
}
var tabLabel = $(this).next().text();
$(this).parent('.depth1-check').append('<button type="button" class="tab-name">'+tabLabel+'</button>');
$(this).siblings('.tab-name').on('click', function() {
$('.depth1').removeClass('on');
$(this).parents('.depth1').addClass('on');
depth2H = $(this).parents('.depth1-check').next('.depth2').outerHeight();
$('.line').attr('style', '');
$(this).parents('.line').height(depth2H + 50);
});
});
$('.pop-advanced-search .depth2 input').change(function() {
if ($(this).is(':checked')) {
$(this).parents('.depth2').siblings('.depth1-check').find('input').prop('checked', true);
} else {
if ($(this).parents('.depth2').find('input:checked').length <= 0) {
$(this).parents('.depth2').siblings('.depth1-check').find('input').prop('checked', false);
}
}
});
// depth-1 열고 닫기
$('.filter-tit .btn-toggle').on('click', function() {
if($(this).text() == '닫기') {
$(this).text('열기');
$(this).parent('.filter-tit').siblings('.filter-list').stop().slideUp();
$('.filter .btn-toggle-more').css('display','none');
} else {
$(this).text('닫기');
$(this).parent('.filter-tit').siblings('.filter-list').stop().slideDown();
$('.filter .btn-toggle-more').css('display','block');
}
});
// depth-2 열고 닫기
$('.filter .depth-1 .btn-toggle').on('click', function () {
var _this = $(this).parents('li').index();
if ($(this).text() == '닫기') {
$(this).text('열기');
$(this).siblings('.check').find('.tab-name').trigger("click");
} else {
$(this).text('닫기');
$(this).siblings('.check').find('.tab-name').trigger("click");
}
});
$('.filter-wrap .tab-name').on('click', function() {
if ($('body').hasClass('pop-filter')) {
$(this).parents('.depth-1').removeClass('on');
}
});
// 상세검색 팝업 열기
$('.btn-search-detail').on('click', function () {
// 클릭 시, 컨텐츠 로딩되도록 처리 (2021.10.20 DDDDDDDDDD 추가) : 시작
$("#NLIB_LAYER_POPUP").addClass("popup pop-advanced-search");
$("#NLIB_LAYER_POPUP").load("/search/getDetailedSearchFormPopup.do");
// 클릭 시, 컨텐츠 로딩되도록 처리 (2021.10.20 DDDDDDDDDD 추가) : 종료
$('.pop-advanced-search').fadeIn();
$('html,body').addClass('no-scroll');
});
//팝업닫기버튼 클릭
$('.btn-close-pop').on('click', function () {
$(this).parents('.popup').fadeOut();
$('html,body').removeClass('no-scroll');
});
});
// 회원가입 셀렉트박스
jQuery(function($) {
var now = new Date();
var year = now.getFullYear();
var mon = (now.getMonth() + 1) > 9 ? ''+(now.getMonth() + 1) : '0'+(now.getMonth() + 1);
var day = (now.getDate()) > 9 ? ''+(now.getDate()) : '0'+(now.getDate());
// 년도
for(var i = 1900 ; i <= year ; i++) {
$('#year').append('<option value="' + i + '">' + i + '년</option>');
}
// 월별
for(var i=1; i <= 12; i++) {
var mm = i > 9 ? i : "0"+i ;
$('#month').append('<option value="' + mm + '">' + mm + '월</option>');
}
// 일별
for(var i=1; i <= 31; i++) {
var dd = i > 9 ? i : "0"+i ;
$('#day').append('<option value="' + dd + '">' + dd+ '일</option>');
}
$("#year > option[value="+year+"]").attr("selected", "true");
$("#month > option[value="+mon+"]").attr("selected", "true");
$("#day > option[value="+day+"]").attr("selected", "true");
});
// 회원가입 체크박스
$('input.sex[type="checkbox"]').bind('click',function() {
$('input.sex[type="checkbox"]').not(this).prop("checked", false);
});
// 회원가입 체크박스
$('input.ser-chk1[type="checkbox"]').bind('click',function() {
$('input.ser-chk1-1[type="checkbox"]').not(this).prop("checked", true);
if($("input.ser-chk1").prop("checked")){
$("input.ser-chk1-1[type=checkbox]").prop("checked",true);
}else{
$("input.ser-chk1-1[type=checkbox]").prop("checked",false);
}
});
// 회원가입 체크박스
$('input.ser-chk2[type="checkbox"]').bind('click',function() {
$('input.ser-chk2-2[type="checkbox"]').not(this).prop("checked", true);
if($("input.ser-chk2").prop("checked")){
$("input.ser-chk2-2[type=checkbox]").prop("checked",true);
}else{
$("input.ser-chk2-2[type=checkbox]").prop("checked",false);
}
});
// 소장자료 디테일 목차정보
$('.down-btn').click(function(){
if($('.down-btn').hasClass('on') === false) {
$(this).addClass('on');
$('.h-down').css('height','auto');
} else {
$(this).removeClass('on');
$('.h-down').css('height','');
}
});
// 공유하기 팝업
$('.share').click(function(){
$('.pop-sharing').fadeIn();
});
// 닫기
$('.pop-sharing .btn-close-pop').on('click', function () {
$('.pop-sharing').fadeOut();
});
// 비밀번호 변경 팝업
$('.pop-change-btn').click(function(){
$('.pop-change').fadeIn();
});
// 닫기
$('.change-close, .close').on('click', function () {
$('.pop-change').fadeOut();
});
// 알림 아코디언
$('.list-accordion .question').on('click', function() {
$('.list-accordion .answer').stop().slideUp(300);
$(this).next('.answer').stop().slideDown(300);
$('.list-accordion .question').removeClass('on');
$(this).addClass('on');
});
/* 메인 메뉴 반응형 */ /* 메인 메뉴 반응형 */
jQuery(function($) { jQuery(function($) {
$.fn.responsivenav = function(args) { $.fn.responsivenav = function(args) {
@ -225,236 +497,116 @@ $(document).ready(function(){
}); });
/* 메인 메뉴 반응형 end */ /* 메인 메뉴 반응형 end */
/* 인기자료 탭메뉴 */ });
(function ($) {
$('.tab ul.tabs').addClass('active').find('> li:eq(0)').addClass('current');
$('.tab ul.tabs li a').click(function (g) {
var tab = $(this).closest('.tab'),
index = $(this).closest('li').index();
tab.find('ul.tabs > li').removeClass('current'); // 검색 필터 관련
$(this).closest('li').addClass('current'); $(document).ready(function() {
// depth-1 열고 닫기
tab.find('.tab_content').find('div.tabs_item').not('div.tabs_item:eq(' + index + ')').hide(); $('.filter-tit .btn-toggle').on('click', function() {
tab.find('.tab_content').find('div.tabs_item:eq(' + index + ')').show(); if($(this).text() == '닫기') {
g.preventDefault(); $(this).text('열기');
}); $(this).parent('.filter-tit').siblings('.filter-list').stop().slideUp();
})(jQuery); $('.filter .btn-toggle-more').css('display','none');
} else {
/* 푸터 관련사이트 */ $(this).text('닫기');
$(".family_site").click(function(){ $(this).parent('.filter-tit').siblings('.filter-list').stop().slideDown();
$(this).toggleClass("on"); $('.filter .btn-toggle-more').css('display','block');
$(this) .find(".site_depth").slideToggle("fast"); }
}); });
/* 로그인 팝업 */ // depth-2 열고 닫기
$(".login-btn").click(function(){ $('.filter .depth-1 .btn-toggle').on('click', function () {
$(".pop-login").fadeIn(); var _this = $(this).parents('li').index();
}); if ($(this).text() == '닫기') {
$(".pop-login .login-close").click(function(){ $(this).text('열기');
$(".pop-login").fadeOut(); $(this).siblings('.check').find('.tab-name').trigger("click");
}); } else {
$(this).text('닫기');
/* 로그인 연결 팝업 */ $(this).siblings('.check').find('.tab-name').trigger("click");
$(".login-connect-btn").click(function(){ }
$(".pop-login-connect").fadeIn(); });
});
$(".pop-login-connect .login-close").click(function(){ $('.filter-wrap .tab-name').on('click', function() {
$(".pop-login-connect").fadeOut(); if ($('body').hasClass('pop-filter')) {
}); $(this).parents('.depth-1').removeClass('on');
}
/* 로그인 연결 패스워드 팝업 */ });
$(".login-password-btn").click(function(){
$(".pop-login-password").fadeIn(); //더보기 버튼
}); $('.filter .btn-toggle-more').on('click', function() {
$(".pop-login-password .login-close").click(function(){ if($(this).text() == '더보기') {
$(".pop-login-password").fadeOut(); $(this).text('접기');
}); $(this).addClass('on');
$(this).siblings('.filter-list').children('ul').children('li').css('display', 'block');
// scroll top button } else {
$(window).scroll(function() { $(this).text('더보기');
var $window = $(window); $(this).removeClass('on');
var $document = $(document); $(this).siblings('.filter-list').children('ul').children('li').each(function () {
var $footer = $('#footer'); if($(this).index() > 3) {
var $scrollBtn = $('#btn-go-top'); $(this).css('display','none');
}
$scrollBtn.on('click', function () { });
$("html, body").stop().animate({ }
scrollTop: 0 });
}, 600);
return false; // 하위 리스트 보기
}); $('.filter-wrap .depth-1 .check input').each(function () {
var tabLabel = $(this).next().text();
btnXPosition(); if($(this).parents('.depth-1').siblings('.depth-2').length > 0) { //하위 조건이 있을 경우만 버튼 생성
$window.resize(function () { $(this).parent('.check').append('<button type="button" class="tab-name">' + tabLabel + '</button>');
btnXPosition(); }
});
$(this).siblings('.tab-name').on('click', function () {
// top버튼 x좌표설정 var _this = $(this).parents('li').index();
function btnXPosition() {
var rightPosition = ($document.width() - 1756) / 2 $(this).parents('li').siblings('li').find('.depth-1').removeClass('on');
if (!$('body').hasClass('pop-filter')) {
// X position if ($(this).parents('.depth-1').hasClass('on')) {
if($document.width() > 1756) { $(this).parents('.depth-1').removeClass('on');
//$scrollBtn.css('right', rightPosition); } else {
$scrollBtn.css('right', '25px'); $(this).parents('.depth-1').addClass('on');
} else { }
$scrollBtn.css('right', '25px'); } else {
} $(this).parents('.depth-1').addClass('on');
} }
$window.on('scroll', function () { // 줄구분용 data 추가
if ($window.scrollTop() < $document.height() - $window.height() - $footer.outerHeight() + 37) { $(".pop-culture-center .line-1").data("idx", "1");
$scrollBtn.addClass('go-top-fix'); $(".pop-culture-center .line-2").data("idx", "2");
} else { $(".pop-culture-center .line-3").data("idx", "3");
$scrollBtn.removeClass('go-top-fix');
} target = $(".pop-filter li.line-" + $(this).parents("li").data("idx") + "");
size = $(this).parents("div.depth-1").next().outerHeight() + 50 ;
if ($window.scrollTop() < ($window.height() / 3)) { $(".line-1 , .line-2, .line-3").attr("style" , '');
$scrollBtn.addClass('go-top-hide'); target.css("height" , size );
} else {
$scrollBtn.removeClass('go-top-hide'); });
}
}); $(this).change( function () {
}); var _this = $(this).parents('li').index();
if ($(this).is(":checked")) {
// 상세검색 팝업 - 문화원정보 선택영역 초기작업 메서드 분리 $(this).parents('.depth-1').next().stop().slideDown(0);
jQuery(function($) { $(this).parents('.depth-1').addClass('on');
var depth2H = 0; $(this).parents('li').siblings('li').find('.depth-1').children('.btn-toggle').text('열기');
$('.pop-advanced-search .depth1-check input').each(function () { $(this).parents('li').find('.depth-1').children('.btn-toggle').text('닫기');
$(this).parents('li').siblings('li').find('.depth-1').next().stop().slideUp(0);
if ($(this).is(":checked")) { // 활성화 line에 높이 잡아주기 $(this).parents('li').siblings('li').find('.depth-1').removeClass('on');
$('.depth1').removeClass('on'); }
$(this).parents('.depth1').addClass('on'); });
depth2H = $(this).parents('.depth1-check').next('.depth2').outerHeight(); });
$(this).parents('.line').siblings('.line').attr('style', '');
$(this).parents('.line').height(depth2H + 50); $('.filter-wrap .depth-2 input').change(function () {
} if ($(this).is(':checked')) {
$(this).parents('.depth-2').siblings('.depth-1').find('input').prop('checked', true);
var tabLabel = $(this).next().text(); } else {
$(this).parent('.depth1-check').append('<button type="button" class="tab-name">'+tabLabel+'</button>'); if ($(this).parents('.depth-2').find('input:checked').length <= 0) {
$(this).parents('.depth-2').siblings('.depth-1').find('input').prop('checked', false);
$(this).siblings('.tab-name').on('click', function() { }
$('.depth1').removeClass('on'); }
$(this).parents('.depth1').addClass('on'); });
depth2H = $(this).parents('.depth1-check').next('.depth2').outerHeight();
$('.line').attr('style', '');
$(this).parents('.line').height(depth2H + 50);
});
});
$('.pop-advanced-search .depth2 input').change(function() {
if ($(this).is(':checked')) {
$(this).parents('.depth2').siblings('.depth1-check').find('input').prop('checked', true);
} else {
if ($(this).parents('.depth2').find('input:checked').length <= 0) {
$(this).parents('.depth2').siblings('.depth1-check').find('input').prop('checked', false);
}
}
});
// depth-1 열고 닫기
$('.filter-tit .btn-toggle').on('click', function() {
if($(this).text() == '닫기') {
$(this).text('열기');
$(this).parent('.filter-tit').siblings('.filter-list').stop().slideUp();
$('.filter .btn-toggle-more').css('display','none');
} else {
$(this).text('닫기');
$(this).parent('.filter-tit').siblings('.filter-list').stop().slideDown();
$('.filter .btn-toggle-more').css('display','block');
}
});
// depth-2 열고 닫기
$('.filter .depth-1 .btn-toggle').on('click', function () {
var _this = $(this).parents('li').index();
if ($(this).text() == '닫기') {
$(this).text('열기');
$(this).siblings('.check').find('.tab-name').trigger("click");
} else {
$(this).text('닫기');
$(this).siblings('.check').find('.tab-name').trigger("click");
}
});
$('.filter-wrap .tab-name').on('click', function() {
if ($('body').hasClass('pop-filter')) {
$(this).parents('.depth-1').removeClass('on');
}
});
// 상세검색 팝업 열기
$('.btn-search-detail').on('click', function () {
// 클릭 시, 컨텐츠 로딩되도록 처리 (2021.10.20)
$("#NLIB_LAYER_POPUP").addClass("popup pop-advanced-search");
$("#NLIB_LAYER_POPUP").load("/search/getDetailedSearchFormPopup.do");
$('.pop-advanced-search').fadeIn();
$('html,body').addClass('no-scroll');
});
//팝업닫기버튼 클릭
$('.btn-close-pop').on('click', function () {
$(this).parents('.popup').fadeOut();
$('html,body').removeClass('no-scroll');
});
});
// 회원가입 셀렉트박스
jQuery(function($) {
var now = new Date();
var year = now.getFullYear();
var mon = (now.getMonth() + 1) > 9 ? ''+(now.getMonth() + 1) : '0'+(now.getMonth() + 1);
var day = (now.getDate()) > 9 ? ''+(now.getDate()) : '0'+(now.getDate());
// 년도
for(var i = 1900 ; i <= year ; i++) {
$('#year').append('<option value="' + i + '">' + i + '년</option>');
}
// 월별
for(var i=1; i <= 12; i++) {
var mm = i > 9 ? i : "0"+i ;
$('#month').append('<option value="' + mm + '">' + mm + '월</option>');
}
// 일별
for(var i=1; i <= 31; i++) {
var dd = i > 9 ? i : "0"+i ;
$('#day').append('<option value="' + dd + '">' + dd+ '일</option>');
}
$("#year > option[value="+year+"]").attr("selected", "true");
$("#month > option[value="+mon+"]").attr("selected", "true");
$("#day > option[value="+day+"]").attr("selected", "true");
});
// 회원가입 체크박스
$('input.sex[type="checkbox"]').bind('click',function() {
$('input.sex[type="checkbox"]').not(this).prop("checked", false);
});
// 회원가입 체크박스
$('input.ser-chk1[type="checkbox"]').bind('click',function() {
$('input.ser-chk1-1[type="checkbox"]').not(this).prop("checked", true);
if($("input.ser-chk1").prop("checked")){
$("input.ser-chk1-1[type=checkbox]").prop("checked",true);
}else{
$("input.ser-chk1-1[type=checkbox]").prop("checked",false);
}
});
// 회원가입 체크박스
$('input.ser-chk2[type="checkbox"]').bind('click',function() {
$('input.ser-chk2-2[type="checkbox"]').not(this).prop("checked", true);
if($("input.ser-chk2").prop("checked")){
$("input.ser-chk2-2[type=checkbox]").prop("checked",true);
}else{
$("input.ser-chk2-2[type=checkbox]").prop("checked",false);
}
});
}); });