647 lines
23 KiB
JavaScript
647 lines
23 KiB
JavaScript
$(document).ready(function(){
|
|
|
|
/* 상단 메뉴 Fixed */
|
|
$( window ).scroll(function() {
|
|
var TopVal = $( window ).scrollTop();
|
|
var TopFixed1 = 300;
|
|
var TopFixed2 = 303;
|
|
if( TopFixed1 <= TopVal){
|
|
$("#header").removeClass("scroll_off");
|
|
$("#header").addClass("scroll_on");
|
|
$(".nav-wrap").removeClass("scroll_off");
|
|
$(".nav-wrap").addClass("scroll_on");
|
|
}else{
|
|
$("#header").removeClass("scroll_on");
|
|
$("#header").addClass("scroll_off");
|
|
$(".nav-wrap").removeClass("scroll_on");
|
|
$(".nav-wrap").addClass("scroll_off");
|
|
}
|
|
});
|
|
|
|
/* 푸터 관련사이트 */
|
|
$(".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);
|
|
}
|
|
|
|
$(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() {
|
|
var html = "";
|
|
var depth1 = "";
|
|
var depth2 = "";
|
|
/*alert(name.substring(name.indexOf("_")+1, name.length));*/
|
|
if ($(this).is(':checked')) {
|
|
depth1 = $(this).parents('.depth2').siblings('.depth1-check').find('label').text();
|
|
depth2 = $("label[for='"+$(this).attr('id')+"']").text();
|
|
|
|
html = "<li><button type=\"button\" onclick=\"function('');\" title=\"삭제\" name=\""+ $(this).attr('id') +"\">" + depth1 + "<span class=\"sign\"> > </span>"+ depth2 +"</button></li>"
|
|
|
|
$(this).parents('.depth2').siblings('.depth1-check').find('input').prop('checked', true);
|
|
$(this).parents('.conditions-box').siblings('.selected-conditions').find('.conditions').append(html);
|
|
|
|
} else {
|
|
$("button[name="+$(this).attr('id')+"]").remove();
|
|
if ($(this).parents('.depth2').find('input:checked').length <= 0) {
|
|
$(this).parents('.depth2').siblings('.depth1-check').find('input').prop('checked', false);
|
|
}
|
|
}
|
|
//filter_mylist clk array
|
|
var filter_mylist = "";
|
|
var filter_mylist_clk = "";
|
|
filter_mylist = $('#d_filter_mylist').val();
|
|
|
|
|
|
if($(this).attr('name') == 'second_class'){
|
|
filter_mylist_clk = 'class_'+$(this).val() +',';
|
|
}else if($(this).attr('name') == 'second_category'){
|
|
filter_mylist_clk = 'category_'+$(this).val() +',';
|
|
}
|
|
|
|
if($(this).is(":checked")){
|
|
filter_mylist += filter_mylist_clk;
|
|
|
|
}else{
|
|
filter_mylist = filter_mylist.replace(filter_mylist_clk,'');
|
|
}
|
|
$('#d_filter_mylist').val(filter_mylist);
|
|
|
|
//depth-1
|
|
var on_classArr = document.querySelectorAll("div.depth1.on");
|
|
var filter_class = "" ;
|
|
var filter_category = "" ;
|
|
for(var i=0; i<on_classArr.length; i++){
|
|
if($(on_classArr[i]).find('input').attr('name') == 'first_class') {
|
|
filter_class = $(on_classArr[i]).find('input').val();
|
|
}else{
|
|
filter_category = $(on_classArr[i]).find('input').val();
|
|
}
|
|
}
|
|
|
|
var listForm = document.forms["d_referencelistForm"];
|
|
listForm.filter_class.value = filter_class;
|
|
listForm.filter_category.value = filter_category;
|
|
|
|
});
|
|
|
|
// 상세검색 초기화
|
|
$('.pop-advanced-search .btn-reset-conditions').on('click', function() {
|
|
$("input[id^='"+$(this).attr('name')+"-chk']").each(function() {
|
|
$(this).prop('checked', false);
|
|
});
|
|
$(this).parents('.title').siblings('.conditions').find('*').remove();
|
|
});
|
|
// 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($) {
|
|
$.fn.responsivenav = function(args) {
|
|
// Default settings
|
|
var defaults = {
|
|
responsive: true,
|
|
width: 768, // Responsive width
|
|
button: $(this).attr('id')+'-button', // Menu button id
|
|
animation: { // Menu animation
|
|
effect: 'slide', // Accepts 'slide' or 'fade'
|
|
show: 150,
|
|
hide: 100
|
|
},
|
|
selected: 'selected', // Selected class
|
|
arrow: 'downarrow' // Dropdown arrow class
|
|
};
|
|
var settings = $.extend(defaults, args);
|
|
// Initialize the menu and the button
|
|
init($(this).attr('id'), settings.button);
|
|
|
|
function init(menuid, buttonid) {
|
|
setupMenu(menuid, buttonid);
|
|
// Add a handler function for the resize and orientationchange event
|
|
$(window).bind('resize orientationchange', function(){ resizeMenu(menuid, buttonid); });
|
|
// Trigger initial resize
|
|
resizeMenu(menuid, buttonid);
|
|
}
|
|
|
|
function setupMenu(menuid, buttonid) {
|
|
var $mainmenu = $('#'+menuid+'>ul');
|
|
var $headers = $mainmenu.find("ul").parent();
|
|
// Add dropdown arrows
|
|
$headers.each(function(i) {
|
|
var $curobj = $(this);
|
|
$curobj.children('a:eq(0)').append('<span class="'+settings.arrow+'"></span>');
|
|
});
|
|
|
|
if ( settings.responsive ) {
|
|
// Menu button click event
|
|
// Displays top-level menu items
|
|
$('#'+buttonid).click(function(e) {
|
|
e.preventDefault();
|
|
|
|
if ( isSelected($('#'+buttonid)) ) {
|
|
// Close menu
|
|
collapseChildren('#'+menuid);
|
|
animateHide($('#'+menuid), $('#'+buttonid));
|
|
} else {
|
|
// Open menu
|
|
animateShow($('#'+menuid), $('#'+buttonid));
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function resizeMenu(menuid, buttonid) {
|
|
var $ww = document.body.clientWidth;
|
|
// Add mobile class to elements for CSS use
|
|
// instead of relying on media-query support
|
|
if ( $ww > settings.width || !settings.responsive) {
|
|
$('#'+menuid).removeClass('mobile');
|
|
$('#'+buttonid).removeClass('mobile');
|
|
} else {
|
|
$('#'+menuid).addClass('mobile');
|
|
$('#'+buttonid).addClass('mobile');
|
|
}
|
|
|
|
var $headers = $('#'+menuid+'>ul').find('ul').parent();
|
|
|
|
$headers.each(function(i) {
|
|
var $curobj = $(this);
|
|
var $link = $curobj.children('a:eq(0)');
|
|
var $subul = $curobj.find('ul:eq(0)');
|
|
|
|
// Unbind events
|
|
$curobj.unbind('mouseenter mouseleave');
|
|
$link.unbind('click');
|
|
animateHide($curobj.children('ul:eq(0)'));
|
|
|
|
if ( $ww > settings.width || !settings.responsive ) {
|
|
// Full menu
|
|
$curobj.hover(function(e) {
|
|
var $targetul = $(this).children('ul:eq(0)');
|
|
|
|
var $dims = { w: this.offsetWidth,
|
|
h: this.offsetHeight,
|
|
subulw: $subul.outerWidth(),
|
|
subulh: $subul.outerHeight()
|
|
};
|
|
var $istopheader = $curobj.parents('ul').length == 1 ? true : false;
|
|
$subul.css($istopheader ? {} : { top: 0 });
|
|
var $offsets = { left: $(this).offset().left,
|
|
top: $(this).offset().top
|
|
};
|
|
var $menuleft = $istopheader ? 0 : $dims.w;
|
|
$menuleft = ( $offsets.left + $menuleft + $dims.subulw > $(window).width() ) ? ( $istopheader ? -$dims.subulw + $dims.w : -$dims.w ) : $menuleft;
|
|
$targetul.css({ left:$menuleft+'px',
|
|
width:$dims.subulw+'px'
|
|
});
|
|
|
|
animateShow($targetul);
|
|
},
|
|
function(e) {
|
|
var $targetul = $(this).children('ul:eq(0)');
|
|
animateHide($targetul);
|
|
});
|
|
} else {
|
|
// Compact menu
|
|
$link.click(function(e) {
|
|
e.preventDefault();
|
|
|
|
var $targetul = $curobj.children('ul:eq(0)');
|
|
if ( isSelected($curobj) ) {
|
|
collapseChildren($targetul);
|
|
animateHide($targetul);
|
|
} else {
|
|
//collapseSiblings($curobj);
|
|
animateShow($targetul);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
collapseChildren('#'+menuid);
|
|
|
|
if ( settings.responsive && isSelected($('#'+buttonid)) ) {
|
|
//collapseChildren('#'+menuid);
|
|
$('#'+menuid).hide();
|
|
$('#'+menuid).removeAttr('style');
|
|
$('#'+buttonid).removeClass(settings.selected);
|
|
}
|
|
}
|
|
|
|
function collapseChildren(elementid) {
|
|
// Closes all submenus of the specified element
|
|
var $headers = $(elementid).find('ul');
|
|
$headers.each(function(i) {
|
|
if ( isSelected($(this).parent()) ) {
|
|
animateHide($(this));
|
|
}
|
|
});
|
|
}
|
|
|
|
function collapseSiblings(element) {
|
|
var $siblings = element.siblings('li');
|
|
$siblings.each(function(i) {
|
|
collapseChildren($(this));
|
|
});
|
|
}
|
|
|
|
function isSelected(element) {
|
|
return element.hasClass(settings.selected);
|
|
}
|
|
|
|
function animateShow(menu, button) {
|
|
if ( !button ) { var button = menu.parent(); }
|
|
|
|
button.addClass(settings.selected);
|
|
|
|
if ( settings.animation.effect == 'fade' ) {
|
|
menu.fadeIn(settings.animation.show);
|
|
$(".BG").fadeIn("fast");
|
|
} else if ( settings.animation.effect == 'slide' ) {
|
|
menu.slideDown(settings.animation.show);
|
|
$(".BG").fadeIn("fast");
|
|
} else {
|
|
menu.show();
|
|
menu.removeClass('hide');
|
|
}
|
|
}
|
|
|
|
function animateHide(menu, button) {
|
|
if ( !button ) { var button = menu.parent(); }
|
|
|
|
if ( settings.animation.effect == 'fade' ) {
|
|
menu.fadeOut(settings.animation.hide, function() {
|
|
menu.removeAttr('style');
|
|
button.removeClass(settings.selected);
|
|
$(".BG").fadeOut("fast");
|
|
});
|
|
} else if ( settings.animation.effect == 'slide' ) {
|
|
menu.slideUp(settings.animation.hide, function() {
|
|
menu.removeAttr('style');
|
|
button.removeClass(settings.selected);
|
|
$(".BG").fadeOut("fast");
|
|
});
|
|
} else {
|
|
menu.hide();
|
|
menu.addClass('hide');
|
|
menu.removeAttr('style');
|
|
button.removeClass(settings.selected);
|
|
}
|
|
}
|
|
$(".BG").click(function(){
|
|
$(".BG").fadeOut("fast");
|
|
$("#primary-nav.mobile").hide();
|
|
$("#primary-nav-button").removeClass("selected");
|
|
});
|
|
};
|
|
});
|
|
|
|
jQuery(function ($) {
|
|
$('#primary-nav').responsivenav();
|
|
$('#top-nav').responsivenav({responsive:false});
|
|
});
|
|
/* 메인 메뉴 반응형 end */
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 검색 필터 관련
|
|
$(document).ready(function() {
|
|
// 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');
|
|
}
|
|
});
|
|
|
|
//더보기 버튼
|
|
$('.filter .btn-toggle-more').on('click', function() {
|
|
if($(this).text() == '더보기') {
|
|
$(this).text('접기');
|
|
$(this).addClass('on');
|
|
$(this).siblings('.filter-list').children('ul').children('li').css('display', 'block');
|
|
} else {
|
|
$(this).text('더보기');
|
|
$(this).removeClass('on');
|
|
$(this).siblings('.filter-list').children('ul').children('li').each(function () {
|
|
if($(this).index() > 3) {
|
|
$(this).css('display','none');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
// 하위 리스트 보기
|
|
$('.filter-wrap .depth-1 .check input').each(function () {
|
|
var tabLabel = $(this).next().text();
|
|
if($(this).parents('.depth-1').siblings('.depth-2').length > 0) { //하위 조건이 있을 경우만 버튼 생성
|
|
$(this).parent('.check').append('<button type="button" class="tab-name">' + tabLabel + '</button>');
|
|
}
|
|
|
|
$(this).siblings('.tab-name').on('click', function () {
|
|
var _this = $(this).parents('li').index();
|
|
|
|
$(this).parents('li').siblings('li').find('.depth-1').removeClass('on');
|
|
if (!$('body').hasClass('pop-filter')) {
|
|
if ($(this).parents('.depth-1').hasClass('on')) {
|
|
$(this).parents('.depth-1').removeClass('on');
|
|
} else {
|
|
$(this).parents('.depth-1').addClass('on');
|
|
}
|
|
} else {
|
|
$(this).parents('.depth-1').addClass('on');
|
|
}
|
|
|
|
// 줄구분용 data 추가
|
|
$(".pop-culture-center .line-1").data("idx", "1");
|
|
$(".pop-culture-center .line-2").data("idx", "2");
|
|
$(".pop-culture-center .line-3").data("idx", "3");
|
|
|
|
target = $(".pop-filter li.line-" + $(this).parents("li").data("idx") + "");
|
|
size = $(this).parents("div.depth-1").next().outerHeight() + 50 ;
|
|
$(".line-1 , .line-2, .line-3").attr("style" , '');
|
|
target.css("height" , size );
|
|
|
|
});
|
|
|
|
$(this).change( function () {
|
|
var _this = $(this).parents('li').index();
|
|
if ($(this).is(":checked")) {
|
|
$(this).parents('.depth-1').next().stop().slideDown(0);
|
|
$(this).parents('.depth-1').addClass('on');
|
|
$(this).parents('li').siblings('li').find('.depth-1').children('.btn-toggle').text('열기');
|
|
$(this).parents('li').find('.depth-1').children('.btn-toggle').text('닫기');
|
|
$(this).parents('li').siblings('li').find('.depth-1').next().stop().slideUp(0);
|
|
$(this).parents('li').siblings('li').find('.depth-1').removeClass('on');
|
|
}
|
|
});
|
|
});
|
|
|
|
$('.filter-wrap .depth-2 input').change(function () {
|
|
if ($(this).is(':checked')) {
|
|
$(this).parents('.depth-2').siblings('.depth-1').find('input').prop('checked', true);
|
|
} else {
|
|
if ($(this).parents('.depth-2').find('input:checked').length <= 0) {
|
|
$(this).parents('.depth-2').siblings('.depth-1').find('input').prop('checked', false);
|
|
}
|
|
}
|
|
});
|
|
}); |