×
{"type":"img","src":"https://cdn.quv.kr/dftb6od4e%2Fup%2F60b98c1e0cf3f_1920.png","height":"80"}
  • 회사소개
  • 제품소개
  • 견적요청
  • 고객지원
  • PARTNER
  • {"google":["Questrial","Noto Sans"],"custom":["SCDream","Noto Sans KR","Nanum Barun Gothic"]}
    ×
     
     
    섹션 설정
    {"type":"img","src":"//cdn.quv.kr/dftb6od4e/up/6073a8cbc1c94_1920.jpg","height":"40"}
  • 회사소개
  • 제품소개
  • 견적요청
  • 고객지원
  • 회사소개

    CORPORATE INFORMATION

    제품소개

    PRODUCT DESCRIPTION

    견적요청

    CONTACT US

    고객지원

    CUSTOMER SERVICE 

    오시는 길

    LOCATION

    SC-TECH

    원칙과 신뢰의 기업

    POWER분야를 선도하는 기업

    Contact us

    SC-TECH 오시는길

    주소     경기도 안양시 동안구 엘에스로 122, 호계데시앙플렉스720호

    전화     031)455-8701, 8731

    팩스     031)455-8703

    이메일     [email protected]

    {"google":["Questrial"],"custom":["SCDream","Noto Sans KR","Nanum Barun Gothic"]}{"google":["Questrial","Noto Sans","Roboto"],"custom":["SCDream","Noto Sans KR","Nanum Barun Gothic"]}
    {"google":["Questrial"],"custom":["Noto Sans KR"]}
    OSZAR »
    '; // iframe.src = 'data:text/html;charset=utf-8,' + encodeURIComponent(html); // target.append($(iframe)); // } // iframe 높이 할당 // const interval = setInterval(function() { // const h = $(iframe).css('height'); // if (h != '100%') { // clearInterval(interval); // $(iframe).parents('.iframeBox').height(h); // } // },100); // var iframeBoxInterval = window.setInterval(function() { // if (iframe.contentWindow.document.readyState === "complete") { // window.clearInterval(iframeBoxInterval); // // grab the content of the iframe here // console.log('iframebox loaded') // } // }, 100); } } // // function initFilter() { // if ($('.filter-area').length == 0) return; // // $('body').delegate('.filter-item', 'click', function() { // $(this).toggleClass('active'); // // if ($('.filter-item.active').length == 0) { // $('.gallery-board-box').removeClass('disapear'); // // } // else { // $.each($('.filter-item'), function() { // var filter_code = $(this).find('.filter-item-name').text(); // if ($(this).hasClass('active')) { // $('.gallery-board-box[data-filter-code="' + filter_code + '"]').removeClass('disapear'); // } // else { // $('.gallery-board-box[data-filter-code="' + filter_code + '"]').addClass('disapear'); // } // }); // } // }); // // $('body').delegate('.filter-header', 'click', function() { // $('.filter-body').toggleClass('active'); // if ($('.filter-body').hasClass('active')) { // $(this).parents('.box').css('border-bottom', '1px solid #eee'); // } // else { // $(this).parents('.box').css('border-bottom', 'none'); // } // }); // // $.each($('.gallery-board-box'), function() { // var filter_code = $(this).find('.gallery-board-caption-title > span').text(); // $(this).attr('data-filter-code', filter_code); // }); // } // // function initColorChip() { // if ($('.color-chip-area').length == 0) return; // // $('#main_container').delegate('.color-chip-item', 'click', function() { // var url = $(this).attr('data-url'); // var target = $(this).parents('.color-chip-container').siblings('.color-chip-image'); // // var temp_image = new Image(); // temp_image.src = url; // $(temp_image).one('load',function() { // $(target).attr('src', url); // }); // // $(this).siblings('.color-chip-item').removeClass('active'); // $(this).addClass('active'); // }); // // $.each($('.color-chip-area'), function() { // $(this).find('.color-chip-item').first().trigger('click'); // }); // } function initDatabaseContents() { if ($('.databaseContentsBox').length > 0) { let DATABASE_CONTENTS = {}; $.each($('.databaseContentsBox'), function () { const area = $(this).find('.dbc-area'); const id = area.attr('data-id'); const count = area.attr('data-count'); const paging = area.attr('data-paging'); const matrix = area.children('.dbc-item:first-of-type').clone(); qvjax_direct( "select_database_contents", "/module/dbc/databaseContents.php", '&cid=' + id, function (data) { if (data.length > 0) { // const column_defs = JSON.parse(data[0].column_defs); const row_data = JSON.parse(data[0].row_data.replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t")); const size = Math.ceil(row_data.length / count); DATABASE_CONTENTS[id] = { data: row_data, size: size, }; // let pagingHtml = '
    '; for (let i = 1; i <= size; i++) { // pagingHtml += '' + i + ''; DATABASE_CONTENTS[id][i] = DATABASE_CONTENTS[id]['data'].slice(count * (i-1), count * i); } // pagingHtml += '
    '; if (paging == 1) { // area.after(pagingHtml); area.after('
      '); buildDatabaseContentsPagingHtml(DATABASE_CONTENTS[id], area, 1); } pagingDatabaseContents(DATABASE_CONTENTS[id][1], matrix, area); } area.show(); }, function (xhr) {} ); }); $('.databaseContentsBox').delegate('.pager li', 'click', function() { const area = $(this).parents('.databaseContentsBox').find('.dbc-area'); const matrix = area.children('.dbc-item:first-of-type').clone(); const id = area.attr('data-id'); const page = $(this).attr('value'); const databaseContents = DATABASE_CONTENTS[id]; if (databaseContents) { buildDatabaseContentsPagingHtml(databaseContents, area, page); pagingDatabaseContents(databaseContents[page], matrix, area); if (isMobile()) { const scrollY = area.offsetTop(); $("html, body").animate({scrollTop: scrollY - 50}, 500); } } }); function buildDatabaseContentsPagingHtml(databaseContents, area, page) { var page = parseInt(page); var size = databaseContents.size; var pagingStart; var pagingEnd; var html = ''; if (page - 2 <= 0) { pagingStart = 1; pagingEnd = Math.ceil(size) >= pagingStart + 4 ? 5 : Math.ceil(size); } else if (page + 2 >= Math.ceil(size)) { pagingStart = Math.ceil(size) - 4 <= 0 ? 1 : Math.ceil(size) - 4; pagingEnd = Math.ceil(size); } else { pagingStart = page - 2; pagingEnd = page + 2; } html += '
    1. '; html += ''; html += '
    2. '; for(var i = pagingStart; i <= pagingEnd; i ++) { var buttonClassName = i == page ? 'btn btn--basic active' : 'btn btn--basic'; html += '
    3. '; html += '
    4. '; } html += '
    5. '; html += ''; html += '
    6. '; area.next('.pager').find('.paging-btn-group').children('.paging-btn-group__item').remove(); area.next('.pager').find('.paging-btn-group').append(html); } function pagingDatabaseContents(data, matrix, area) { const $frag = $(document.createDocumentFragment()); area.children('.dbc-item').remove(); $.each(data, function() { const clone = matrix.clone(); const rowData = this; $.each(clone.find('.dbc-contents-item'), function() { const connect = $(this).attr('data-connect'); const type = $(this).attr('data-type'); switch (type) { case '1': case '3': $(this).find('p:last-of-type').text(rowData[connect]); break; case '2': $(this).find('img').attr('src', rowData[connect]); break; } }); clone.find('style').remove(); clone.attr('data-id', this.id); $frag.append(clone); }); area.append($frag); } $('body').delegate('.databaseContentsBox .dbc-area[data-detail="1"] .dbc-item', 'click', function() { const page = $(this).parents('.dbc-area').first().attr('data-id'); const id = $(this).attr('data-id'); if (page && id) { location = '/' + page + '?id=' + id; } else { alert('데이터 컨텐츠 설정 오류', page, id); } }); } } function initDownloadButton() { $('#main_container').delegate('.qv-file-download', 'click', function() { var url = $(this).attr('data-download-url'); if (!url || url == '') return; var name = $(this).attr('data-download-url').split('/').pop(); url = url.split('/').reduce(function(p, c, idx) { var slash = (c == '') ? '//' : '/'; var add = (idx == url.split('/').length -1) ? encodeURIComponent(c) : c + slash; return p + add; }); if ((navigator.userAgent.toLowerCase().indexOf('safari') > -1 && navigator.userAgent.toLowerCase().indexOf('chrome') == -1) || is_InternetExplorer()) { var a = $("").attr("href", url).attr("download", name).appendTo("body"); a[0].click(); a.remove(); } else { post_redirect('/module/board/download.php', {'url': url, 'name': name}, '_top'); } }); } function initLanguageSelector() { if ($('.header .languageSelectorBox').length > 0) { var LANGUAGE_CODE = {'ko':'한국어', 'en':'English', 'zh-chs':'中文(简体)', 'zh-cht':'中文(繁體)', 'ja':'日本語'}; $('body').delegate('.language-selector.language-type-3', 'click', function() { if ($(this).find('.language-dropdown').length > 0) { $(this).find('.language-dropdown').remove(); } else { var html = '
      '; $.each($(this).find('.language-selector-flag'), function() { var lang = $(this).attr('data-lang'); var href = $(this).children('a').attr('href'); var target = $(this).children('a').attr('target') ? $(this).children('a').attr('target') : '_self'; html += '
      ' + LANGUAGE_CODE[lang] + '
      '; }); html += '
      '; } $(this).append(html); // 2020.12.04 높이 지정 불필요함 // var top = $(this).position().top + 40; // $('.language-dropdown').css('top', top); }); } } function initMouseoverObjects() { // mouseover 객체 내에 애니메이션 컨텐츠가 있으면 hover 에서도 동작하도록 하는 코드. // 오동작이 있기 때문에 다시 구축해야 함 // $('#main_container').delegate('.mouseover-frm', 'mouseenter', function() { // console.log('enter'); // $.each($(this).find('.mouseover-after'), function() { // var elm = this; // var newone = elm.cloneNode(true); // elm.parentNode.replaceChild(newone, elm); // }); // }); // $('#main_container').delegate('.mouseover-frm', 'mouseleave', function() { // console.log('enter'); // $.each($(this).find('.mouseover-before'), function() { // var elm = this; // var newone = elm.cloneNode(true); // elm.parentNode.replaceChild(newone, elm); // }); // }); function resizeMouseoverFrame(mouseoverFrame) { var before = mouseoverFrame.find('.mouseover-before').first(); var after = mouseoverFrame.find('.mouseover-after').first(); var mouseover_height = before.height() > after.height() ? before.height() : after.height(); if (mouseover_height == 0) { var data_height = mouseoverFrame.attr('data-hei') ? parseInt(mouseoverFrame.attr('data-hei')) : 0; data_height = data_height == 0 ? mouseoverFrame.find('.imgBox:first').height() : data_height; mouseover_height = data_height; } if (mouseoverFrame.height() < mouseover_height) { var tb = mouseoverFrame.children('.view').children('.tb'); // tb.height(mouseover_height); if (tb.length > 0) { tb.get(0).style.setProperty('height', mouseover_height + 'px', 'important'); } } } $(window).bind("load",function() { // tb의 높이보다 하위 컨텐츠의 높이가 더 클 경우 tb의 높이를 맞춰준다. // mouseover 객체들이 absolute로 전환되기 때문에 높이를 수동으로 지정해주지 않으면 컨텐츠들이 겹치게 됨 $.each($('#main_container .mouseover-frm'), function() { const mouseoverFrame = $(this); mouseoverFrame.find('.box').each(function(i, val) { $(val).addClass('displayed'); }); // mouseover frame 내 이미지를 모두 호출한 뒤 위치를 다시 잡아준다 let loadCompleteCount = 0; const imageCore = $(this).find('.img-core'); const imageCount = imageCore.length; if (imageCount === 0) { resizeMouseoverFrame(mouseoverFrame); } else { imageCore.each(function() { const img = new Image(); const bg = $(this).css('background-image'); if (bg.indexOf('url(') === 0) { img.src = bg.replace('url(','').replace(')','').replace(/\"/gi, ""); $(img).one('load',function(){ loadCompleteCount++; if (loadCompleteCount === imageCount) { resizeMouseoverFrame(mouseoverFrame); } }) } else { loadCompleteCount++; if (loadCompleteCount === imageCount) { resizeMouseoverFrame(mouseoverFrame); } } }) } }); // 이미지 박스 전용 mouseover // 향후 실제 사용여부는 확인필요 $.each($('#main_container .imgBox'), function() { var mouseover_image = $(this).find('.img-core').attr('data-mouseover-image'); if (mouseover_image) { var image = $(this).find('.img-core'); var dummy = $(this).find('.img-core-dummy'); image.attr('data-default-image', image.css('background-image')); $(this).on('mouseenter', function () { console.log('imgBox mouse enter'); image.css('background-image', image.attr('data-mouseover-image')); dummy.attr('src', image.attr('data-mouseover-image').replace('url(', '').replace(')', '').replace(/\"/gi, "")) }); $(this).on('mouseleave', function () { console.log('imgBox mouse leave'); image.css('background-image', image.attr('data-default-image')); dummy.attr('src', image.attr('data-default-image').replace('url(', '').replace(')', '').replace(/\"/gi, "")) }); } }); }); } function initMobileFooterFixedContents() { if (isMobile() && $('.footer-fixed-contents').length > 0) { $(window).bind("load",function() { // fixed 크기만큼 페이지 최하단에 공백넣음 var footer_fixed = $('.footer-fixed-contents'); var empty_div = '
      '; $('.footer-frame-mobile').after($(empty_div)); }); } } function initHeaderOverflowMenuResizeEvent() { var column; $.each($('#main_container .header .al-box'), function() { if ($(this).children('ul.mn-ul').length > 0 && $(this).find('.mn-item').length > 0) { column = $(this); } }); if (column) { headerOverflowMenuInit(column); } $(window).resize(function() { if(this.resizeTO) clearTimeout(this.resizeTO); this.resizeTO = setTimeout(function() { $(this).trigger('resizeEnd'); }, 100); }); $(window).bind('resizeEnd', function() { if (column) { headerOverflowMenuInit(column); } }); } function headerOverflowMenuInit(column) { if (column.children('ul.mn-ul').length == 0) { return; } var column_width = 0; var box_width = 0; var overflow_menu = []; var container = column.parents('#main_container'); var menu = column.children('ul.mn-ul'); var header_contents = column.parents('.header-contents').first(); var header = header_contents.parent(); var header_width = column.parent().css('width'); if (header_width.indexOf('%') > -1) { // %로 리턴됨 -> px 값 계산해서 처리 (IE에서 가끔 %로 넘어옴) header_width = $(window).width() * parseInt(header_width) / 100; } else { // px로 리턴 -> 그대로 처리 header_width = parseInt(header_width); } $.each(column.children('div.box'), function() { box_width += $(this).width(); box_width += parseInt($(this).css('padding-left')) box_width += parseInt($(this).css('padding-right')) }); column_width += box_width; container.find('.mn-item').removeClass('mn-item-overflow'); $.each(menu.children('.mn-item').not('.mn-item-overflow-list'), function() { column_width += $(this).width(); if (header_width < column_width + 110) { $(this).addClass('mn-item-overflow'); overflow_menu.push($(this)); } }); if (overflow_menu.length > 0) { if (menu.find('headerstart').length == 0) { menu.prepend(''); } if (menu.find('headerend').length == 0) { menu.append(''); } if (menu.find('.mn-item-overflow-list').length == 0) { var html = '
    7. '; menu.find('headerend').before($(html)); } container.find('.header-overflow-pop ul li').remove(); $.each(overflow_menu, function() { var clone = $(this).clone(); menu.find('.header-overflow-pop ul').append(clone); }); } else { container.find('.mn-item-overflow-list').remove(); } } function initMobileHeaderMenu() { if ((isMobile() && window.innerWidth <= 767) && $('.header').length > 0) { // menu touch if ($('.header-mobile .column > ul.mn-ul').length > 0) { // 현재 활성화된 페이지의 메뉴 위치 잡기 $(window).bind("load",function() { // 서브메뉴 추가 if ($('.header-mobile .column > ul.mn-ul').data('sub')) { if ($('.header-mobile .column > ul.mn-ul .mn-item.cur-mn-item > ul.sub-mn > li.mn-item').length > 0) { // 메인 메뉴 중에 cur-mn-item이 존재할 경우 var sub_mn = $('.header-mobile .column > ul.mn-ul .mn-item.cur-mn-item > ul.sub-mn'); } else if ($('.header-mobile .column > ul.mn-ul .mn-item > ul.sub-mn > li.mn-item.cur-mn-item').length > 0) { // 서브 메뉴 중에 cur-mn-item이 존재할 경우 var sub_mn = $('.header-mobile .column > ul.mn-ul .mn-item > ul.sub-mn > li.mn-item.cur-mn-item').parent(); } if (sub_mn) { var header_contents = sub_mn.parents('.header-contents'); var sub_html = '
      ' + '
      ' + '' + '
      ' + '
      '; sub_html = $(sub_html).css('background', header_contents.css('background')); sub_html = $(sub_html).css('border-bottom', header_contents.css('border-bottom')); header_contents.append($(sub_html)); var header_cur = header_contents.parent(); var header_next = header_cur.next('div'); $.each(header_next, function () { var top = 0; $.each($(this).prev('div'), function () { top += $(this).find('.header-contents').height(); top += $(this).find('.header-contents > div:last-child').height(); }); $(this).attr('data-top', top); $(this).css('top', top); }); } } if ($('.header-mobile .column > ul.mn-ul .mn-item.cur-mn-item').length > 0) { var cur = $('.header-mobile .column > ul.mn-ul .mn-item.cur-mn-item').last(); var ul = cur.parents('ul.mn-ul').first(); var pos = cur[0].offsetLeft * -1; var width = ul.parents('.column').parent().width(); var max = (ul.width() - width) * -1; pos = pos < 0 ? pos : 0; max = max < 0 ? max : 0; pos = pos <= max ? max : pos; ul.css('transform', 'translate3d(' + pos + 'px, 0, 0)'); ul.data('pos', pos); } var startPoint; $('#main_container').delegate('.header-mobile .column > ul.mn-ul', "touchstart", function (e) { startPoint = e.originalEvent.touches[0].screenX; var pos = parseInt($(this).data('pos')); if (!pos) { $(this).data('pos', 0); } }); $('#main_container').delegate('.header-mobile .column > ul.mn-ul', "touchmove", function (e) { var event = e.originalEvent; var x = event.touches[0].screenX; var diff = x - startPoint; var width = $(e.currentTarget).parents('.column').parent().width(); var max = ($(this).width() - width) * -1; var pos = parseInt($(this).data('pos')); pos += diff; pos = pos < 0 ? pos : 0; max = max < 0 ? max : 0; pos = pos <= max ? max : pos; $(this).css('transform', 'translate3d(' + pos + 'px, 0, 0)'); }); $('#main_container').delegate('.header-mobile .column > ul.mn-ul', "touchend", function () { if ($(this).css('transform').indexOf('matrix') > -1) { $(this).data('pos', $(this).css('transform').split(',')[4].trim()); } }); }); // 카테고리 항목 클릭 시 하위 페이지가 있으면 // 해당 페이지 목록(header-mobile-sub-menu)을 동적으로 만들어준다 $('#main_container').delegate('.header-mobile .al-box > .mn-ul > .mn-item > .mn-link:not([href])', 'click', function() { if ($('.header-mobile .column > ul.mn-ul').data('sub')) { var sub_mn = $(this).siblings('ul.sub-mn'); if (sub_mn) { $('.header-mobile-sub-menu').remove(); var header_contents = sub_mn.parents('.header-contents'); var sub_html = '
      ' + '
      ' + '' + '
      ' + '
      '; sub_html = $(sub_html).css('background', header_contents.css('background')); sub_html = $(sub_html).css('border-bottom', header_contents.css('border-bottom')); header_contents.append($(sub_html)); var header_cur = header_contents.parent(); var header_next = header_cur.next('div'); $.each(header_next, function () { var top = 0; $.each($(this).prev('div'), function () { top += $(this).find('.header-contents').height(); top += $(this).find('.header-contents > div:last-child').height(); }); $(this).attr('data-top', top); $(this).css('top', top); }); } } }); } // section merge // var section_merge = $('.header-mobile > .header1').data('section-merge'); // if (section_merge == false || location.pathname.indexOf('/module/board') > -1) { // merge = false 거나 게시글 쓰기/읽기 에서는 헤더영역 확보 // var height = 0; // $.each($('.header-mobile > div'), function() { // height += parseInt($(this).attr('data-hei')); // }); // $('#main_container > .body')[0].style.setProperty('margin-top', height + 'px', 'important'); // } // else if (section_merge == true) { // $('#main_container > .body')[0].style.setProperty('margin-top', 0, 'important'); // $('#main_container > .body > .frm')[0].style.setProperty('margin-top', 0, 'important'); // } // $(window).bind("load",function() {}); // section merge ver.2 if ($('#main_container .body > mobile-header-section-merge').length > 0) { $('#main_container > .header-mobile').addClass('mobileHeaderSectionMerge'); $('#main_container > .body')[0].style.setProperty('margin-top', 0, 'important'); $('#main_container > .body > .frm')[0].style.setProperty('margin-top', 0, 'important'); } else { $('#main_container > .header-mobile').removeClass('mobileHeaderSectionMerge'); var height = 0; $.each($('.header-mobile > div'), function () { height += parseInt($(this).attr('data-hei')); }); /* 2020.05.21 재헌 * 서브메뉴가 존재할 때 해당 높이도 더해서 body에 margin-top을 부여 */ if ($('.header-mobile-sub-menu').length > 0) { height += $('.header-mobile-sub-menu').height(); } $('#main_container > .body')[0].style.setProperty('margin-top', height + 'px', 'important'); } } } function initHeaderSideNav() { $('#main_container').delegate('.header-side-nav-button', 'click', function() { $('.header-side-nav').toggleClass('active'); if ($(this).parents('.header-mobile').length > 0) { $(this).parents('.header1, .header2, .header3, .header9').addClass('z-index-9999'); } // header-side-nav 영역만큼 밀어내기 // $('.body').css('width', "calc(100% - 500px)"); }); $('#main_container').delegate('.header-side-nav-close', 'click', function() { $('.header-side-nav').removeClass('active'); if ($(this).parents('.header-mobile').length > 0) { setTimeout(function() { // 사이드 네비 닫히는 시간 0.3ms, z-index 빠지는 시간 0.5ms $(this).parents('.header1, .header2, .header3, .header9').removeClass('z-index-9999'); }, 500) } // header-side-nav 영역만큼 밀어내기 // $('.body').removeAttr('style'); }); /* 2020.03.16 재헌 * language selector, header side nav 같은 별도의 창을 띄우는 헤더 요소가 * header1, header2의 z-index 영향을 받아 위로 겹치거나 의도대로 동작하지 않는 문제를 수정 */ $('#main_container').delegate('.header > div', 'mouseenter', function() { if ($('.language-dropdown').length > 0 || $('.header-side-nav.active').length > 0) return; $(this).css('z-index', 2); }); $('#main_container').delegate('.header > div', 'mouseleave', function() { if ($('.language-dropdown').length > 0 || $('.header-side-nav.active').length > 0) return; $(this).css('z-index', 1); }); } // 이미지 중 모바일 높이가 지정되지 않은 항목들 및 부모 프레임 크기 지정 function initNonScaledImageBox() { if (!isMobile()) return; var image_count = 0; var target_count = 0; $.each($('.body .imgBox'), function() { if ($(this).parents('.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11').length > 0) return; if ($(this).parents('.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11').length > 0) return; if ($(this).find('.mobile-box').length > 0) return; if ($(this).parents('.popup-container').length > 0) return; if ($(this).parents('.fixed-contents-layer').length > 0) return; if ($(this).parents('.tab-frm, .slider-frm').length > 0) return; var bg_size = $(this).find('.img-core').css('background-size'); if (bg_size == 'contain') { image_count++; } }); $.each($('.body .imgBox'), function() { if ($(this).parents('.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11').length > 0) return; if ($(this).parents('.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11').length > 0) return; if ($(this).find('.mobile-box').length > 0) return; if ($(this).parents('.popup-container').length > 0) return; if ($(this).parents('.fixed-contents-layer').length > 0) return; if ($(this).parents('.tab-frm, .slider-frm').length > 0) return; var img_box = $(this); var bg_size = $(this).find('.img-core').css('background-size'); var bg_image = $(this).find('.img-core').css('background-image'); if (bg_image) { bg_image = bg_image.replace('url(', '').replace(')', '').replace(/\"/gi, ""); } if (bg_size == 'contain') { var tmpImg = new Image(); tmpImg.src = bg_image; $(tmpImg).one('load',function(){ var ratio = tmpImg.width / tmpImg.height; var height_origin = img_box.height(); var width_resize = window.innerWidth; // img_box.width()는 퍼센트로 출력되기때문에 window width로 대체 var height_resize = width_resize/ratio; var diff = height_origin - height_resize; // 모바일 스크린보다 작은 이미지, 가로가 더 긴 이미지 등은 패스한다 if (ratio > 1 || height_resize < window.innerHeight || height_origin * ratio < window.innerHeight) { return; } img_box.height(height_resize); img_box.find('.img-core').height(height_resize); img_box.attr('data-m-hei', height_resize + 'px'); img_box.data('diff', diff); target_count++; if (target_count == image_count) { resizeNonScaledImageBoxUpperFrame(); } }); } }); } function resizeNonScaledImageBoxUpperFrame() { $.each($('.body > .frm'), function() { var re = 0; var image_count = 0; $.each($(this).find('.box.imgBox'), function() { re += parseInt($(this).data('diff')); image_count++; }); if (image_count > 0 && !isNaN(re)) { $.each($(this).find('.frm').andSelf(), function () { if ($(this).height() - re < 0) return; resetMobileFrameStyle($(this)); }); } }); } function resetMobileFrameStyle($frm) { $frm.children('.view').children('.tb').css('height', 'auto'); } function initRss() { if ($('.rssBox').length > 0) { $('.rssBox .rss-area > ul').remove(); $('.rssBox .view').append($('
      ')); $(window).bind("load",function() { // jquery.rss.js 동적 호출 $.getScript( "/js/jquery.rss.js", function( data, textStatus, jqxhr ) { $.each($('.rssBox'), function() { var box = $(this); var target = box.find('.rss-area'); var rss_url = target.attr('data-rss-url'); var limit = target.attr('data-contents-limit'); jQuery(function($) { target.rss(rss_url, { limit: limit, dateFormat: 'YYYY-MM-DD kk:mm', entryTemplate: '
    8. {title}{nicetime}{bodyPlain}..
    9. ', tokens: { nicetime: function(entry, tokens) { var createDateTime = new Date(tokens.date).getTime(); var currentDateTime = new Date(); var compareDateTime = currentDateTime.setDate(currentDateTime.getDate() - 1); if (createDateTime > compareDateTime) { return getNiceTime(createDateTime, new Date(), 1, true); } else { return tokens.date; } }, }, success: function(data){ box.find('.qv-loader').remove(); }, error: function(xhr){ box.find('.qv-loader').remove(); }, }) }) }); }); }); } } function initLnb() { if ($('.lnbBox').length > 0) { var path = QV_BASE_OBJ.spid; $('.lnb-area .lnb-item[data-spid="' + path + '"]').addClass('active'); } } // 모바일 터치 참고 https://fullcalendar.io/docs/longPressDelay function initCalendar(elements) { if ($('.calendarBox').length > 0) { // calendar script 동적 호출 $.getScript( "/js/fullcalendar/moment.min.js", function( data, textStatus, jqxhr ) { $.getScript( "/js/fullcalendar/fullcalendar.min.js", function( data, textStatus, jqxhr ) { $.getScript( "/module/calendar/calendar.js", function( data, textStatus, jqxhr ) { if (elements) { buildCalendar(elements); } else { $.each($('.calendarBox'), function() { buildCalendar(this); }); } }); }); }); } } function initPageFadeEvent() { var page_effect = 0; if (page_effect == 1) { $('body').addClass('body-fade'); $('.body-fade').delegate('a', 'click', function(e) { var target = $(this); var targetUrl = document.activeElement.href; if (target.attr('class').indexOf('cke') > -1) return; else if (target.attr('target') == '_blank') return; else if (target.attr('href') == undefined) return; else if (target.attr('href').indexOf('#sld') > -1) return; else if (target.attr('href').indexOf('#tab') > -1) return; else if (targetUrl === 'javascript:void(0)') return; else if (targetUrl == undefined) return; else if (targetUrl.substr(targetUrl.length - 1) == '#') return; else if (targetUrl != undefined && targetUrl != '') { e.preventDefault(); $('body').fadeOut( "fast", function() { location.href = targetUrl; }); } }); } } function initJoinModal() { $('#main_container').delegate('a[href="/join"]', 'click', function() { if (NAVER_CLIENT_ID == '' && KAKAO_CLIENT_ID == '' && GOOGLE_CLIENT_ID == '') { location.href = "/join"; return; } else { $('#JoinModal').modal('show'); return false; } }); } function initPolicyPrivacyModal() { $('#main_container').delegate('a[href="/policy_privacy"]', 'click', function() { if ($('#PolicyPrivacyModal').data('policy')) { $('#PolicyPrivacyModal').modal('show'); } else { qvjax_direct( "select_terms", "/module/member/member.php", '', function (data) { if (data.length > 0) { var m = "privacy"; var text = $.grep(data, function (e) { return e.stms_type == m; })[0].stms_txt; $('#policy-privacy-textarea').val(text); $('#PolicyPrivacyModal').modal('show'); $('#PolicyPrivacyModal').data('policy', data); } }, function (xhr) { } ); } return false; }); } function removeSiteCopiedElement() { // 복제된 게시판, 폼 삭제처리 $('#main_container .SiteCopiedElement').remove(); } function initSnSIconImage() { $.each($('.sns-icon-image'), function() { if ($(this).width() < 40) { var bg = $(this).css('background-image'); if (bg.toLowerCase().indexOf('color-30') > 0 || bg.toLowerCase().indexOf('color-30') > 0) { return; } if (bg.indexOf('-30') > -1) return; var convertSmall = bg.replace('Color', 'Color-30').replace('Black', 'Black-30'); $(this).css('background-image', convertSmall); } }); } function initSliderCallback() { $.each($('.slider-frm .carousel.slide'), function() { $(this).bind('slide.bs.carousel', function (e) { //$(this).find('.qv-ani-ele').toggleClass('qv-ani-ele qv-ani'); $(e.relatedTarget).find('.qv-ani').toggleClass('qv-ani qv-ani-ele'); $.each($(e.relatedTarget).find('.video-iframe'), function() { var src; if ($(this).attr('src')) { src = $(this).attr('src').split('×tamp=')[0]; } else if ($(this).attr('data-src')) { src = $(this).attr('data-src').split('×tamp=')[0]; } if (src) { $(this).attr('src', src + '×tamp=' + new Date().getTime()); } }); }); }); } function initSlider(element) { /* 2020.03.12 재헌 * 슬라이드 배경 이미지는 초기화 시 미리 불러온다 * 미리 불러오지 않으면 슬라이드 넘길 때 마다 흰 화면이 나타남 */ const target = element ? element : $('.slider-frm') $.each(target.find('.carousel-inner > .item > .frm'), function() { var url = $(this).css('background-image'); if (url == 'none' || url.indexOf('url') == -1) return; else { var img = new Image(); img.src = url.match(/url\(["']?([^"']*)["']?\)/)[1]; } }); // carousel 스윕 $.each(target.not('.fullpage').find('.carousel'), function() { $.each($(this).find('.item'), function(i) { var active = i == 0 ? ' active' : ''; $(this).attr('class', 'item' + active); }); $(this).find('.carousel-indicators > li').removeClass('active'); $(this).find('.carousel-indicators > li').first().addClass('active'); $(this).carousel({ swipe: 200 }); $(this).carousel(0); /* 2020.02.25 재헌 * 자동 넘기기 시간 간격 조정 */ if($(this).attr('data-slider-interval')) { var slider = $(this); var interval = parseInt($(this).attr('data-slider-interval')); interval = interval >= 1000 ? interval : 5000; var sliderInterval = setInterval(function() { slider.carousel("next"); }, interval); } }); } function initFullPageSlider() { if ($('#main_container > .body > .fullpage').length == 0) return; $.each($('.slider-frm.fullpage'), function() { $(this).find('.carousel.slide').carousel(0); $(this).find('.item').each(function(i, val) { if (i === 0) { $(val).addClass('active').removeAttr('style'); } else { $(val).removeClass('active').attr('style', 'transform: translate3d(0px, 100%, 0px);'); } }) }); var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ? true : false; if(!isMobile) { $('#main_container').delegate('.slider-frm.fullpage', 'mousewheel', function (e, delta) { //$('.slider-frm.fullpage').on('mousewheel', function (e, delta) { if (delta == undefined) { // 2019.01.02 delta 값이 undefined로 넘어와서 아래와 같이 처리 if (e.originalEvent.wheelDelta > 0) delta = 1; else delta = -1; } var is_fullpage_scrolling = $(this).attr('data-scrolling') == "true" ? true : false; if (is_fullpage_scrolling) { e.preventDefault(); return false; } $(this).attr('data-scrolling', true); var index = $(this).find('.carousel.slide .carousel-inner > .item.active').index() + 1; var total = $(this).find('.carousel.slide .carousel-inner > .item').length; var active_item = $(this).find('.carousel.slide .carousel-inner > .item.active'); if (delta == 1) { if (index == 1) { $(this).attr('data-scrolling', false); return; } $(this).find('.carousel.slide').carousel("prev"); var scrollY = parseInt(this.offsetTop); $("html, body").animate({scrollTop: scrollY}, 300); // 2019-05-13 재헌 // fullpage 위/아래 슬라이드 시 가끔씩 오동작 하는 부분이 있어서 스크립트로 제어함 active_item.prev().removeAttr('style'); active_item.css('transform', 'translate3d(0, 100%, 0)'); } else { if (index == total) { $(this).attr('data-scrolling', false); return; } $(this).find('.carousel.slide').carousel("next"); var scrollY = parseInt(this.offsetTop); $("html, body").animate({scrollTop: scrollY}, 300); // 2019-05-13 재헌 // fullpage 위/아래 슬라이드 시 가끔씩 오동작 하는 부분이 있어서 스크립트로 제어함 active_item.next().removeAttr('style'); active_item.css('transform', 'translate3d(0, -100%, 0)'); } return false; }); } else { // touchmove 이벤트 제거. 일부 브라우저에서 스크롤 오동작함 (safari) $('.slider-frm.fullpage').bind('touchmove', function(e){e.preventDefault()}); $('.slider-frm.fullpage').on('swipedown swipeup', function (e) { var is_fullpage_scrolling = $(this).attr('data-scrolling') == "true" ? true : false; if (is_fullpage_scrolling) { // e.preventDefault(); return false; } $(this).attr('data-scrolling', true); var index = $(this).find('.carousel.slide .carousel-inner > .item.active').index() + 1; var total = $(this).find('.carousel.slide .carousel-inner > .item').length; var active_item = $(this).find('.carousel.slide .carousel-inner > .item.active'); if (e.type == "swipedown") { if (index == 1) { if ($(this).prev('.frm').length > 0) { // var scrollY = parseInt($(this).prev('.frm').offset().top); $("html, body").animate({scrollTop: scrollY}, 200); } else { $("html, body").animate({scrollTop: 0}, 200); } $(this).attr('data-scrolling', false); return; } $(this).find('.carousel.slide').carousel("prev"); var scrollY = parseInt(this.offsetTop); $("html, body").animate({scrollTop: scrollY}, 300); // 2019-05-13 재헌 // fullpage 위/아래 슬라이드 시 가끔씩 오동작 하는 부분이 있어서 스크립트로 제어함 active_item.prev().removeAttr('style'); active_item.css('transform', 'translate3d(0, 100%, 0)'); } else { if (index == total) { var scrollY = parseInt(this.offsetTop + $(this).height()); $("html, body").animate({scrollTop: scrollY}, 200); $(this).attr('data-scrolling', false); return; } $(this).find('.carousel.slide').carousel("next"); var scrollY = parseInt(this.offsetTop); $("html, body").animate({scrollTop: scrollY}, 300); // 2019-05-13 재헌 // fullpage 위/아래 슬라이드 시 가끔씩 오동작 하는 부분이 있어서 스크립트로 제어함 active_item.next().removeAttr('style'); active_item.css('transform', 'translate3d(0, -100%, 0)'); } return false; }); } // 2019-05-13 재헌 // fullpage 위/아래 슬라이드 시 가끔씩 오동작 하는 부분이 있어서 스크립트로 제어함 $('#main_container').on('click', '.fullpage .carousel-indicators > li', function () { var fullpage = $(this).parents('.fullpage').first(); fullpage.find('.carousel-inner > .item').removeAttr('style'); var selected_item_num = $(this).attr('data-slide-to'); var selected_item = $(fullpage.find('.carousel-inner > .item').get(selected_item_num)); selected_item.prev('.item').css('transform', 'translate3d(0, -100%, 0)'); selected_item.next('.item').css('transform', 'translate3d(0, 100%, 0)'); }); // transition init (ie : left, others : transition) $.each($('.fullpage .carousel-inner .item'), function() { $.each($(this).children('.frm'), function(i) { if (is_InternetExplorer()) { $(this).css('transform', 'none'); $(this).css('left', parseInt(i * 100) + 'vw'); } else { $(this).css('transform', 'translate3d(' + parseInt(i * 100) + 'vw,0,0)'); } $(this).removeClass('active'); }); }); $('#main_container').on('click', '.fullpage-slide-control', function () { var item = $(this).parent(); var frames = $(item).children('.frm'); var total_length = frames.length; var active_frm = frames.filter(function () { return $(this).hasClass('active'); }); if (active_frm.length == 0) { active_frm = frames.first(); } var index = active_frm.index(); if ($(this).hasClass('left')) { if (index == 0) { frames.removeClass('active'); frames.last().addClass('active'); $.each(frames, function (i) { var idx = total_length - i - 1; if (is_InternetExplorer()) { $(this).css('left', '-' + parseInt(idx * 100) + 'vw'); } else { $(this).css('transform', 'translate3d(-' + parseInt(idx * 100) + 'vw,0,0)'); } }); } else { $.each(frames, function (i) { var left = (i - index + 1) * 100; if (is_InternetExplorer()) { $(this).css('left', left + 'vw'); } else { $(this).css('transform', 'translate3d(' + left + 'vw,0,0)'); } $(this).removeClass('active'); if (i == index-1) { $(this).addClass('active'); } }); } } else if ($(this).hasClass('right')) { if (index == total_length - 1) { frames.removeClass('active'); frames.first().addClass('active'); $.each(frames, function (i) { if (is_InternetExplorer()) { $(this).css('left', parseInt(i * 100) + 'vw'); } else { $(this).css('transform', 'translate3d(' + parseInt(i * 100) + 'vw,0,0)'); } }); } else { $.each(frames, function (i) { var left = (i - index - 1) * 100; if (is_InternetExplorer()) { $(this).css('left', left + 'vw'); } else { $(this).css('transform', 'translate3d(' + left + 'vw,0,0)'); } $(this).removeClass('active'); if (i == index + 1) { $(this).addClass('active'); } }); } } }); $('.fullpage').find('.carousel.slide').on('slid.bs.carousel', function () { var slider = $(this).parents('.fullpage'); setTimeout(function () { $(slider).attr('data-scrolling', false); }, 550); }); jQuery.fn.carousel.Constructor.TRANSITION_DURATION = 1000 // 2 seconds } function is_InternetExplorer() { var agent = navigator.userAgent.toLowerCase(); return (navigator.appName == 'Netscape' && agent.indexOf('trident') != -1) || (agent.indexOf("msie") != -1); } function initSMS() { qvjax_direct( "select_sms_info", "//" + QV_BASE_OBJ.dev + "g" + QV_BASE_OBJ.svid + "m.quv.kr" + "/qws/aligo.php", '', function (data) { $.each(data, function() { if (this.smi_state == '1') { var hide_icon = ''; var hide_window = ''; var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ? true : false; if(isMobile) { hide_window = 'sms-hide'; } else { if (this.smi_init_show == '1') { hide_icon = 'sms-hide'; } else { hide_window = 'sms-hide'; } } var html = '
      SMS 문자보내기
      ×
      메세지
      연락처
      '; $('.body').append($(html)); $('.sms-header > span').text(this.smi_title); $('.sms-message > textarea').attr('placeholder', this.smi_placeholder); var start = parseInt(this.smi_start_time); var end = parseInt(this.smi_end_time); end = end == 0 ? 2400 : end; var current_hours = new Date().getHours(); var current_minutes = new Date().getMinutes(); var current_time = parseInt(current_hours.toString() + current_minutes.toString()); if (start <= current_time && current_time < end) { $('.smsBox').show(); } else { $('.smsBox').hide(); return; } // sms $('.sms-icon').on('click', function() { var sms = $(this).parents('.smsBox').first(); sms.find('.sms-icon').addClass('sms-hide'); sms.find('.sms').removeClass('sms-hide'); }); $('.sms-close').on('click', function() { var sms = $(this).parents('.smsBox').first(); sms.find('.sms').addClass('sms-hide'); sms.find('.sms-icon').removeClass('sms-hide'); }); $('.sms-contact input').on('change keydown paste input', function() { var number = $(this).val(); if (number.length > 20) { $(this).val($(this).val().slice(0,20)); return false; } this.value = this.value.replace(/[^0-9\.]/g,''); }); $('.sms-footer').on('click', function() { var sms = $(this).parents('.smsBox').first(); var phone = sms.find('.sms-contact input').val(); var message = sms.find('.sms-message textarea').val(); var agree = sms.find('.sms-agree input').prop('checked'); if (!isValidMobileNumber(phone)) { alert(lang.failure_send_sms_invalid_number); return; } if (!agree) { alert(lang.agree_privacy_info); return; } qvjax_direct( "send", "//" + QV_BASE_OBJ.dev + "g" + QV_BASE_OBJ.svid + "m.quv.kr" + "/qws/aligo.php", 'msg=' + message + '&sender=' + phone, function (data) { if (data.result_code == "1" && data.message == "success") { smsSendComplete(data.sshid, data.msg_id, data.msg_type, function() { sms.find('.sms-contact input').val(''); sms.find('.sms-message textarea').val(''); sms.find('.sms-agree input').prop('checked', false); alert(lang.success_send_sms); qv_func.conversion('sms', function() {}) }); } else if (data.result_code == "0") { switch(data.message) { case "frequently_called": alert(lang.failure_send_sms_frequently_called); break; case "too_long_message": alert(lang.failure_send_sms_too_long_message); break; case "low_balance": alert(lang.failure_send_sms_low_balance); break; case "invalid_number": alert(lang.failure_send_sms_invalid_number); break; default: alert(lang.failure_send_sms_default); break; } } else if (data.result_code == '-101') { smsSendFailure(data.sshid, data.result_code, data.message, function() { alert(lang.failure_send_sms_default); }); } }, function (xhr) { } ); }); } }); }, function (xhr) { } ); function smsSendComplete(sshid, msg_id, msg_type, callback) { var type = msg_type.toLowerCase() == 'sms' ? 'sms' : 'lms'; qvjax_direct( "complete", "//" + QV_BASE_OBJ.dev + "g" + QV_BASE_OBJ.svid + "m.quv.kr" + "/qws/aligo.php", 'sshid=' + sshid + '&msg_id=' + msg_id + '&msg_type=' + type, function (data) { callback(); }, function (xhr) { } ) } function smsSendFailure(sshid, res_code, res_error_msg, callback) { qvjax_direct( "failure", "//" + QV_BASE_OBJ.dev + "g" + QV_BASE_OBJ.svid + "m.quv.kr" + "/qws/aligo.php", 'sshid=' + sshid + '&res_code=' + res_code + '&res_error_msg=' + res_error_msg, function (data) { callback(); }, function (xhr) { } ) } function isValidMobileNumber(num) { //if(!num.match(/^\d+$/)) { valid = false; } var arr_head = ['010','011','016','017','018','019','031','032','041','042','043','051','052','053','054','055','061','062','063','064','070','080', '020', '021', '022', '023', '024', '025', '026', '027', '028', '029']; var head = num.slice(0, 3); return $.inArray(head, arr_head) > -1 ? true : false; } } function byteCheck(string){ var utf8length = 0; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utf8length++; } else if((c > 127) && (c < 2048)) { utf8length = utf8length+2; } else { utf8length = utf8length+3; } } return utf8length; } function initTabFrame() { // 2019.01.31 $.each($('.tab-frm'), function() { $(this).find('.tab-frame-nav > ul > li').removeClass('active'); //$(this).find('.tab-frame-nav > ul > li:first-child').addClass('active'); $(this).find('.tab-frame-nav > ul > li:first-child > a').trigger('click'); }); // 2018.09.04 재헌 // URL에 #tab- 형식의 값이 있으면 해당 탭을 활성화한다. var hash = location.hash; if (hash != undefined && hash != '') { if (hash.indexOf('tab-') < 0) { return; } if ($(hash).length == 0) { return; } var tab = $('a[href="' + hash + '"]'); var nav = tab.closest('.tab-frame-nav'); $.each(nav.find('li'), function() { $(this).children('a').attr('aria-expanded', false); $(this).removeClass('active'); }); tab.attr('aria-expanded', true); tab.parent().addClass('active'); /* 2021.08.02 * PC, 모바일 따로 구성하여 같은 id가 두 개 이상 있을 때 * 둘 다 active 클래스 영향을 받도록 함 */ $('div[id="' + hash.replace(/#/g, '') + '"]').each(function() { $(this).siblings().removeClass('active'); $(this).addClass('active'); }); // $(hash).siblings().removeClass('active'); // $(hash).addClass('active'); setTimeout(function(){ $(window).scrollTop(nav.offset().top - $('.header').height()); // $('html, body').animate({ // scrollTop: nav.offset().top - 200 // }, 500); },500); /* 2020.03.19 재헌 * 탭을 mobile_ele로 복사하여 넣은 경우 헤더의 탭 앵커가 동작하지 않기 때문에(id가 달라서) * 이름으로 찾아 활성화한다 */ if (isMobile()) { var tab_name = tab.first().text(); $.each($('.mobile_ele .tab-frame-nav a'), function() { if ($(this).text() == tab_name) { var id = $(this).attr('href'); $(this).parent().siblings().removeClass('active'); $(this).parent().addClass('active'); $('.mobile_ele ' + id).siblings().removeClass('active'); $('.mobile_ele ' + id).addClass('active'); } }); } } // 탭 내에 지도가 있으면 렌더링이 정상적으로 안되는 증상이 있음 // 탭 클릭시 지도를 새로 렌더링 하도록 함 $('#main_container').delegate('.tab-frm .tab-frame-nav li > a', 'click', function(e) { var frm = $(this).parents('.tab-frm').first(); $.each(frm.find('.mapBox'), function() { var map = $(this); map.removeClass('map-rendering-complete'); map.find('.qv-map').children().remove(); setTimeout(function() { renderMapBox(map); }, 100); }); $.each(frm.find('.mapListBox'), function() { var map = $(this); map.removeClass('map-list-rendering-complete'); map.find('.qv-map-list').children().remove(); setTimeout(function() { renderMapListBox(map); }, 100); }); // 동일 페이지에 같은 아이디의 텝이 두개 이상 존재할 때 var tab_id = $(this).attr('href').replace(/#/g, ''); if ($('.tab-pane[id="' + tab_id + '"]').length > 0) { e.preventDefault(); //frm.find('.tab-pane.active').removeClass('active'); frm.find('.tab-content').first().children('.tab-pane.active').removeClass('active'); frm.find('.tab-pane[id="' + tab_id + '"]').addClass('active'); } // 탭 클릭 시 마우스오버 컨텐츠 Initialize $.each(frm.find('.mouseover-frm'), function() { var before = $(this).find('.mouseover-before').first(); var after = $(this).find('.mouseover-after').first(); var mouseover_height = before.height() > after.height() ? before.height() : after.height(); if ($(this).height() < mouseover_height) { var tb = $(this).children('.view').children('.tb'); tb.height(mouseover_height); } }); initIframe(frm.find('.iframeBox')); }); } $(window).on('hashchange', function(e) { var hash = window.location.hash; var oldUrl = e.originalEvent.oldURL; var newUrl = e.originalEvent.newURL; var oldUrl_noHash = oldUrl.indexOf('#') < 0 ? oldUrl : oldUrl.split('#')[0]; var newUrl_noHash = newUrl.indexOf('#') < 0 ? newUrl : newUrl.split('#')[0]; if (hash.indexOf('#tab') > -1 && (oldUrl_noHash == newUrl_noHash)) { window.location.href = newUrl; window.location.reload(); } }); // 픽스드 컨텐츠 초기화 function initFixedContents() { var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ? true : false; if(isMobile) { var fixed = $('body').find('.fixed-contents-layer.fixed-contents-show-mobile'); $.each(fixed, function() { var top = this.style.top; var left = this.style.left; var bottom = this.style.bottom; var right = this.style.right; var ratio = 3; if (top != 'auto') { $(this).css('top', parseFloat(top) / ratio + 'px'); } if (left != 'auto') { $(this).css('left', parseFloat(left) / ratio + 'px'); } if (bottom != 'auto') { $(this).css('bottom', parseFloat(bottom) / ratio + 'px'); } if (right != 'auto') { $(this).css('right', parseFloat(right) / ratio + 'px'); } }); } //Click event to scroll to top & bottom var didScroll = false; $('body').delegate('.scrollToTop', 'click', function(e) { if (!didScroll) { didScroll = true; $('html, body').stop().animate({scrollTop: 0}, 500, 'swing', function() {didScroll = false;}); return false; } }); $('body').delegate('.scrollToBottom', 'click', function(e) { if (!didScroll) { didScroll = true; $('html, body').stop().animate({scrollTop: $('.body').height()}, 500, 'swing', function() {didScroll = false;}); return false; } }); } // 픽스트 컨텐츠 초기화 끝 // Youtube 자동 재생 시작 /* * mute 속성 안주면 자동재생 안됨. 현재 iframe src에 mute=1 속성 부여 * https://stackoverflow.com/questions/40685142/youtube-autoplay-not-working */ $(window).load(function() { // if ($('.video-iframe').length > 0) { /* * Youtube API 로드 * 2019.03.18 재헌 주석처리 * Youtube API 미사용중. 아래 스크립트 때문에 반복재생이 안되는 문제 발생 */ var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); // } }); // iframe 제거하고 새로운 iframe 생성 // iframe이 속한 videoBox를 찾아서, 그 안에 집어넣어주기 // 해당위치에 div를 새롭게 생성하고 원래 있던 내용 집어넣기 // this.id, height 100%, width 100%, class -> video-iframe, data-src function mobileAutoPlayIframe () { $('.videoBox').each(function(){ // vimeo는 해당 로직 필요 없음 if($(this).find('.video-iframe')[0].getAttribute('data-src').indexOf('vimeo') > -1) return; var vBox = $(this).find('.view')[0] var iframe = $(this).find('.video-iframe')[0] var newIframe = document.createElement('div') if (!iframe.id) return; else { newIframe.id = iframe.id; newIframe.className = 'video-iframe'; newIframe.setAttribute('data-src', iframe.getAttribute('data-src')); iframe.remove(); vBox.append(newIframe); }; }) } mobileAutoPlayIframe() var player_list = []; function onYouTubeIframeAPIReady() { $('.videoBox').each(function() { // vimeo는 해당 로직 필요 없음 if($(this).find('.video-iframe')[0].getAttribute('data-src').indexOf('vimeo') > -1) return; var player; var targetId = $(this).find('.video-iframe')[0].id // 기존 아이디 없는 동영상들 놔두기 if(!targetId) return; var videoId = $(this).find('.video-iframe')[0].getAttribute('data-src').split('embed/')[1].split('?')[0] var src = $(this).find('.video-iframe')[0].getAttribute('data-src') var isAutoPlay = src.indexOf('autoplay=1') var isMute = src.indexOf('mute=1') var isLoop = src.indexOf('loop=1') player = new YT.Player(targetId, { height: "100%", width: "100%", videoId: videoId, events: { onReady: onPlayerReady, onStateChange:onPlayerStateChange }, }); // 모바일 자동재생 하기 위해서 src에 autoplay 추가 if(isAutoPlay > 0) { var afterSrc = $('#'+targetId)[0].getAttribute('src') + '&autoplay=1&mute=1'; $('#'+targetId)[0].setAttribute('src',afterSrc); } // 동영상 로드되면 autoplay 실행 function onPlayerReady(event) { if(isAutoPlay > 0) player.playVideo(); } // 재생 끝난 동영상 roop 값 확인하고 다시 재생 function onPlayerStateChange (event) { if(event.data === YT.PlayerState.ENDED && isLoop > 0) player.playVideo(); } }) } // Youtube 자동 재생 끝 // SNS 초기화 시작 function initSnsFeed() { //var sns_feed = $("#main_container div[name*='feed']"); var sns_feed = $("#main_container div.sns-feed"); $.each(sns_feed, function(i, val) { var target = $(val).parents('.box').first(); var feed_token = target.data('feed_token'); var feed_count = target.data('feed_count'); var feed_style = target.data('feed_style'); var feed_column = target.data('feed_column'); var feed_column_m = target.data('feed_column_m'); var feed_height_m = target.data('feed_height_m') == undefined ? $(val).find('.sns-feed-image-layer').height() : target.data('feed_height_m'); var feed_type = target.data('feed_type'); var vBox = $(val).parents('.view').first(); if (feed_type != undefined && feed_token != undefined) { switch(feed_type) { case 'twitter': renderTwitterFeed(feed_token, feed_count, feed_column, feed_column_m, feed_height_m, feed_style, vBox); break; case 'instagram': renderInstagramFeed(feed_token, feed_count, feed_column, feed_column_m, feed_height_m, feed_style, vBox); break; } target.removeAttr('data-feed_token'); } }); } function initInstagramFeed() { var instagram_feed = $('#main_container div.instagramFeedBox'); $.each(instagram_feed, function(i, val) { var target = $(this); var feed_token = target.data('access-token'); var feed_count = target.data('feed-count'); var feed_count_m = target.data('feed-count-m'); var feed_column = target.data('feed-column'); var feed_column_m = target.data('feed-column-m'); var feed_height = target.data('feed-height'); var feed_height_m = target.data('feed-height-m') == undefined ? $(val).find('.sns-feed-image-layer').height() : target.data('feed-height-m'); var feed_margin = target.data('feed-margin'); var vBox = $(val).children('.view').first(); renderInstagramGraphFeed(feed_token, feed_count, feed_column, feed_count_m, feed_column_m, feed_height, feed_height_m, feed_margin, vBox) target.removeAttr('data-access-token'); }); } //(function(d, s, id) { // var js, fjs = d.getElementsByTagName(s)[0]; // if (d.getElementById(id)) return; // js = d.createElement(s); js.id = id; // js.src = 'https://connect.facebook.net/ko_KR/sdk.js#xfbml=1&version=v3.1&appId=786526475012875&autoLogAppEvents=1'; // fjs.parentNode.insertBefore(js, fjs); //}(document, 'script', 'facebook-jssdk')); function initFacebookSDK(d, s, id, c) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = 'https://connect.facebook.net/ko_KR/sdk.js#xfbml=1&version=v3.1&appId=786526475012875&autoLogAppEvents=1'; if (c) { fjs.addEventListener('load', function(e) { c(null, e); }, false); } fjs.parentNode.insertBefore(js, fjs); } function refreshInstagramAccessToken(access_token, callback) { qvjax_direct( "refresh_instagram_access_token", "/module/sns/instagram.php", "&access_token=" + access_token, function(data) { /* result 0 : 토큰 갱신 필요 * result 1 : 정상 */ if (data.result == 0) { $.ajax({ type: "GET", url: "https://graph.instagram.com/refresh_access_token?grant_type=ig_refresh_token&access_token=" + access_token, success: function (response) { console.log('response', response); callback(); }, error: function (xhr) { console.log('[Instagram]\n토큰 갱신에 실패했습니다.\n관리자에게 문의해주세요.', xhr); // if (xhr.responseJSON.error.code === 190) {} } }); } else if (data.result == 1) { callback(); } }, function (xhr) { console.log('xhr', xhr.responseText); callback(); } ) } function renderInstagramGraphFeed(feed_token, feed_count, feed_column, feed_count_m, feed_column_m, feed_height, feed_height_m, feed_margin, vBox) { if (!feed_token) return; refreshInstagramAccessToken(feed_token, function() { $.ajax({ type: "GET", url: "https://graph.instagram.com/me/media?fields=id,caption,media_type,media_url,thumbnail_url,timestamp,permalink&access_token=" + feed_token, success: function (response) { if (!response.data) return else if (response.data.length > 0) { $(vBox.children('div')[0]).empty(); var count = isMobile() ? feed_count_m : feed_count; for (var i = 0; i < count; i++) { var media = response.data[i]; if (!media) return; var thumbnail = media.media_type == "VIDEO" ? media.thumbnail_url : media.media_url; var feed = '
      '; feed += ""; feed += "
      "; feed += '
      '; feed += "
      "; if (media.caption !== undefined) { if (media.caption.length > 0) { var text = media.caption; var length = 100; var trimmedString = text.length > length ? text.substring(0, length - 3) + "..." : text; feed += "

      " + trimmedString + "

      " } } feed += ""; feed += "
      "; feed += " "; feed += getNiceTime(new Date(media.timestamp).getTime(), new Date(), 1, true); feed += "
      "; feed += "
      "; feed += "
      "; feed += "
      "; feed += "
      "; feed += "
      "; $(vBox.children('div')[0]).append(feed); $(vBox).find('.sns-feed').show() } } }, error: function(xhr) { console.log('[Instagram]\n잘못된 계정이거나 존재하지 않는 계정입니다.\n\n계정정보나 비밀번호가 변경되었다면 다시 한 번 연동해주시기 바랍니다.'); console.log('[Instagram ERROR]', JSON.parse(xhr.responseText).error); $(vBox).find('.sns-feed').show(); } }); }); } function renderInstagramFeed(feed_token, feed_count, feed_column, feed_column_m, feed_height_m, feed_style, vBox) { $.ajax({ type: "GET", dataType: "jsonp", cache: false, url: "https://api.instagram.com/v1/users/self/media/recent/?access_token=" + feed_token + "&count=" + feed_count, success: function (response) { if (!response.data) return; else if (response.data.length > 0) { $(vBox.children('div')[0]).empty(); for (var i = 0; i < response.data.length; i++) { var feed = '
      '; feed += ""; feed += "
      "; feed += '
      ' feed += "
      "; feed += "
      "; if (response.data[i].caption !== null) { if (response.data[i].caption.text.length > 0) { var text = response.data[i].caption.text; var length = 100; var trimmedString = text.length > length ? text.substring(0, length - 3) + "..." : text; feed += "

      " + trimmedString + "

      " } } feed += ""; feed += "
      "; feed += ""; feed += getNiceTime(parseInt(response.data[i].created_time) * 1000, new Date(), 1, true); feed += "
      "; feed += "
      "; feed += ""; feed += response.data[i].likes.count; feed += ""; feed += response.data[i].comments.count; feed += "
      "; feed += "
      "; feed += "
      "; feed += "
      "; feed += "
      "; $(vBox.children('div')[0]).append(feed); } } if (response.data.length < feed_count && response.pagination) { if (!response.pagination.next_url) return; else { renderInstagramFeedMore( response.pagination.next_url, feed_count - response.data.length, feed_column, feed_column_m, feed_height_m, feed_style, vBox); } } } }); } // 특정 이유로 인스타그램 피드를 원하는 개수만큼 불러오지 못했을 때 추가로 API를 호출한다 // 저작권이 있는 BGM이 들어간 영상, 재생시간이 1분 이상인 영상 등 // https://smashballoon.com/video-posts-are-missing-or-only-show-thumbnail/ function renderInstagramFeedMore(feed_url, feed_count, feed_column, feed_column_m, feed_height_m, feed_style, vBox) { $.ajax({ type: "GET", dataType: "jsonp", cache: false, url: feed_url, success: function (response) { if (!response.data) return else if (response.data.length > 0) { for (var i = 0; i < feed_count; i++) { var feed = '
      '; feed += ""; feed += "
      "; feed += '
      ' feed += "
      "; feed += "
      "; if (response.data[i].caption !== null) { if (response.data[i].caption.text.length > 0) { var text = response.data[i].caption.text; var length = 100; var trimmedString = text.length > length ? text.substring(0, length - 3) + "..." : text; feed += "

      " + trimmedString + "

      " } } feed += ""; feed += "
      "; feed += ""; feed += getNiceTime(parseInt(response.data[i].created_time) * 1000, new Date(), 1, true); feed += "
      "; feed += "
      "; feed += ""; feed += response.data[i].likes.count; feed += ""; feed += response.data[i].comments.count; feed += "
      "; feed += "
      "; feed += "
      "; feed += "
      "; feed += "
      "; $(vBox.children('div')[0]).append(feed); } } } }); } function renderTwitterFeed(feed_token, feed_count, feed_column, feed_column_m, feed_height_m, feed_style, vBox) { $.ajax({ type: "GET", dataType: "jsonp", cache: false, url: location.protocol + '//quv.kr' + "/auth/twitter/tweets_json.php?count=" + feed_count + "&callback=listTweets&screen_name=" + feed_token, success: function(response) { if (response.length > 0) { $(vBox.children('div')[0]).empty(); for (var i = 0; i < response.length; i++) { if (typeof response[i].entities.media != 'undefined' && response[i].entities.media.length > 0) { var imageUrl = response[i].entities.media[0].media_url_https; var link = response[i].entities.media[0].url; var feedImageHtml = '
      '; } else { var link = 'http://twitter.com/' + response[i].user.screen_name + '/status/' + response[i].id_str; var feedImageHtml = '
      '; } var feed = '
      '; feed += ""; feed += "
      "; feed += feedImageHtml feed += "
      "; if (typeof response[i].entities.media != 'undefined' && response[i].entities.media.length > 0) { feed += "
      "; } else { feed += "
      "; } if (response[i].text.length > 0) { var text = response[i].text; var length = 100; var trimmedString = text.length > length ? text.substring(0, length - 3) + "..." : text; feed += "

      " + trimmedString + "

      " } feed += ""; feed += "
      "; feed += " "; feed += getNiceTime(new Date(Date.parse(response[i].created_at.replace(/( \+)/, ' UTC$1'))), new Date(), 1, true); feed += "
      "; feed += "
      "; feed += " "; feed += response[i].favorite_count; feed += " "; feed += response[i].retweet_count; feed += "
      "; feed += "
      "; feed += "
      "; feed += "
      "; feed += "
      "; $(vBox.children('div')[0]).append(feed); } } } }); } // SNS 초기화 끝 // 모바일용 헤더 초기화 function initMobileHeader() { $('.header-mobile-nav-btn').on('click', function() { $('.header-mobile').addClass('active-side-nav'); }); $('.header-mobile-side-nav-close').on('click', function() { $('.header-mobile').removeClass('active-side-nav'); }); $('#main_container').delegate('.active-side-nav', 'click', function(e) { if ($(e.target).hasClass('header-mobile')) { $('.header-mobile').removeClass('active-side-nav'); } }); $('.header-mobile-side-nav, .header-side-nav').delegate('.mn-dropdown', 'click', function(e) { var parent = $(this).parent(); if (parent.find('ul.sub-mn').length > 0 && !parent.hasClass('active')) { parent.addClass('active'); } else { parent.removeClass('active'); } }); // 모바일에서 스크롤 할 때 헤더에 scroll클래스 추가 $(window).on('scroll', function(e) { if ($(this).scrollTop() > 50) { $('.header-mobile').addClass('scroll'); } else { $('.header-mobile').removeClass('scroll'); } var scrollTop = $(this).scrollTop(); var mobile_header =$('#main_container > .header-mobile > div'); var mobile_header_fixed = $('#main_container > .header-mobile > div[data-scroll-fix="true"]'); if (mobile_header.length != mobile_header_fixed.length) { $.each($('#main_container > .header-mobile > div[data-scroll-fix="true"]'), function () { var min = 0; var max = parseInt($(this).data('top')); var top = max - scrollTop; top = top <= min ? min : top; $(this).css('top', top + 'px'); }); } // 서브메뉴가 존재할 때 header merge 상태이면 // 스크롤 시 header-mobile-sub-menu 배경 색상을 투명에서 기존 색상으로 변경해주는 작업 $.each($('#main_container > .header-mobile .header-mobile-sub-menu'), function() { $(this).css('background', $(this).parent().css('background')); }); }); } // 모바일용 헤드 초기화 끝 // 스크롤 var isScrolling = false; function onScrollBefore() { if (isScrolling) { isScrolling = false; scrollChangeHeaderLogoImage('before'); } } function onScrollAfter() { if (!isScrolling) { isScrolling = true; scrollChangeHeaderLogoImage('after'); } } function scrollChangeHeaderLogoImage(e) { const logo = $('.header .logoBox .logo-img-core.scroll-change'); if (logo && logo.length > 0) { const before = logo.attr('data-before'); const after = logo.attr('data-after'); const src = (e === 'before') ? before : after; if (before && after && src && (logo.attr('src') !== src)) { logo.attr('src', src); } } } function qv_on_scroll(t) { if(window.pageYOffset<=109){ height_sync(".header .header1",109); $("body").addClass("scrollBefore"); $("body").removeClass("scrollAfter");if (typeof onScrollBefore === 'function') { onScrollBefore(); }} if(window.pageYOffset>109){ height_sync(".header .header1",100); $("body").removeClass("scrollBefore"); $("body").addClass("scrollAfter");if (typeof onScrollAfter === 'function') { onScrollAfter(); }} } function qv_on_scroll_ie(t) { if($('body').scrollTop()<=109){ height_sync(".header .header1",109); $("body").addClass("scrollBefore"); $("body").removeClass("scrollAfter");} if($('body').scrollTop()>109){ height_sync(".header .header1",100); $("body").removeClass("scrollBefore"); $("body").addClass("scrollAfter");} } function height_sync(e,hei){ //fixed_scroll_js에서 사용 // 2018.10.12 재헌 // IE 에서 속도 이슈가 발생해 아래와 같이 조건 추가 // hei 값이 변해야 style 수정하도록 함 // if($(e).length>0) { if($(e).length>0 && $(e).height() != hei) { $(e).height(hei); //hide의 경우에도 애니메이팅 효과를 위해, height를 0으로 설정 $.each($(e).find(".hsync"), function() { if ($(this).parents('.header-side-nav').length > 0) { return; } // header-side-nav 하위 ul은 높이 수정하지 않아야 함 $(this).height(hei); $(this).css("line-height", hei + "px"); }); $(e).find(".hsync-nlh").height(hei); $(e).find(".header-contents").height(hei); $(e).find(".img-view").height(hei); $(e).find(".img-core").css('max-height',hei+"px"); $(e).find(".img-op").css('max-height',hei+"px"); $(e).find(".logoBox .logo-img-core").css('max-height',hei+"px"); if(hei<1){ $(e).find(".header-contents").hide(); }else{ $(e).find(".header-contents").show(); } } } function get_hd_obj(){ var obj_hd= {}; $(".header [class^=header]").each(function(){ var header_class=$(this).attr('class'); var cm; if(_cm=header_class.match(/(header)(\d+)(\s+)?$/)) { var hdn=parseInt(_cm[2]); obj_hd[hdn]=$(this).data('hei')+","+$(this).data('scr-hei'); } }); return obj_hd; } function showPopup(popup_id) { qvjax_direct( "get_popup_only_json", "/module/site/site.php", 'stid=' + QV_BASE_OBJ.stid, function (data) { if (data.length > 0) { var popup_obj = $.grep(data, function(e) { return e.key == popup_id }); if (popup_obj.length > 0) { $('.dynamic-popup-container').remove(); $('#main_container').append('
      '); var popup = $(popup_obj[0].contents).clone(); popup.attr('id', popup_id); $(popup).removeClass('body'); $(popup).removeClass('popup-editor'); $(popup).addClass('popup'); $('#main_container .dynamic-popup-container').append($(popup)); } $('.popup-frame-header-close').click(function() { var popup = $(this).parents('.popup'); popup.remove(); if ($('.dynamic-popup-container').children().length <= 0) { $('.dynamic-popup-container').remove(); } }); $('.popup-frame-footer-todayclose').click(function() { var popup = $(this).parents('.popup'); popup.remove(); if ($('.dynamic-popup-container').children().length <= 0) { $('.dynamic-popup-container').remove(); } setCookie(popup.attr('id'), 1, 1); }); $.each($('#main_container .dynamic-popup-container .video-iframe, #main_container .popup-container .video-iframe'), function() { var url = $(this).attr('data-src'); $(this).attr('src', url); }); if ($(popup).find('.formBox').length > 0) { form_initialize(); } if ($(popup).find('.mapBox').length > 0) { initMapBox($(popup).find('.mapBox')); } if ($(popup).find('.gridBox').length > 0) { initGrid($(popup).find('.gridBox')); } if ($(popup).find('.ddayBox').length > 0) { initDday($(popup).find('.ddayBox')) let isCountdown = false $(popup).find('.dday-area-countdown').each(function () { if ($(this).css('display') === 'block') { isCountdown = true return false } }) if (isCountdown) initCountDown() } if ($(popup).find('.calendarBox').length > 0) { initCalendar($(popup).find('.calendarBox')); } if ($(popup).find('.frm[href], .box[href]')) { initFrameLink($(popup).find('.frm[href], .box[href]')); } if ($(popup).find('.slider-frm').length > 0) { initSlider($(popup).find('.slider-frm')); } } }, function (xhr) {} ); } function initPopup() { // 페이지에서만 띄움.header1 // if (location.pathname.length > 1) { return; } // 게시판 읽기/쓰기 때는 안띄움 if (location.pathname.indexOf('/module/board/') > -1) return; qvjax_direct( "get_menu_json", "/module/site/site.php", 'stid=' + QV_BASE_OBJ.stid, function (data) { if (data.length > 0) { var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ? true : false; var popup_grep = $.grep(data, function(e) { return e.key == QV_BASE_OBJ.spid }); if (popup_grep.length == 0) return; var popup_list = popup_grep[0].popup; var popup_array = popup_list.split(','); $('#main_container').append(''); $.each(popup_array, function() { var popup_spid = this; var popup_obj = $.grep(data, function(e) { return e.key == popup_spid && e.type == "popup"; }); if (popup_obj.length > 0) { var popup = $(popup_obj[0].contents).clone(); popup.attr('id', popup_spid); if (getCookie(popup.attr('id')) == 1) { return true; } var start = popup.data('start'); var end = popup.data('end'); if (start > 0 && end > 0) { if (start > $.now()) return; if (end < $.now()) return; } $(popup).removeClass('body'); $(popup).removeClass('popup-editor'); $(popup).addClass('popup'); if (isMobile && $(popup).hasClass('popup-display-pc') || !isMobile && $(popup).hasClass('popup-display-mobile')) return; // popup 다국어처리 if (LANG && LANG != 'ko') { var close = $(popup).find('.popup-frame-header-close'); if (close.text().indexOf('닫기') > -1) { close.html(lang.close + ' clear'); } var todayclose = $(popup).find('.popup-frame-footer-todayclose'); todayclose.text(lang.today_close); } $('#main_container .popup-container').append($(popup)); if ($(popup).find('.mapBox').length > 0) { initMapBox($(popup).find('.mapBox')); } if ($(popup).find('.ddayBox').length > 0) { initDday($(popup).find('.ddayBox')) let isCountdown = false $(popup).find('.dday-area-countdown').each(function () { if ($(this).css('display') === 'block') { isCountdown = true return false } }) if (isCountdown) initCountDown() } if ($(popup).find('.calendarBox').length > 0) { initCalendar($(popup).find('.calendarBox')); } if ($(popup).find('.frm[href], .box[href]')) { initFrameLink($(popup).find('.frm[href], .box[href]')); } if ($(popup).find('.slider-frm').length > 0) { initSlider($(popup).find('.slider-frm')); } } }); $.each($('#main_container .dynamic-popup-container .video-iframe, #main_container .popup-container .video-iframe'), function() { var url = $(this).attr('data-src'); $(this).attr('src', url); }); if(isMobile) { } else { // 드래그는 pc에서만 되도록 함 $('.popup').draggable({ handle: ".popup-frame-header, .popup-frame-footer", start: function( event, ui ) { // 새로 리뉴얼된(margin x) 팝업에만 적용 if (parseInt(ui.helper.css('margin-left')) == 0) { // 드래그할 때 bottom이 0이면 비정상적으로 동작하여 auto로 지정 ui.helper.css({right: 'auto', bottom: 'auto'}); } } }); } $('.popup-frame-header-close').click(function() { var popup = $(this).parents('.popup'); popup.remove(); if ($('.popup-container').children().length <= 0) { $('.popup-container').remove(); } }); $('.popup-frame-footer-todayclose').click(function() { var popup = $(this).parents('.popup'); popup.remove(); if ($('.popup-container').children().length <= 0) { $('.popup-container').remove(); } setCookie(popup.attr('id'), 1, 1); }); } if ($('.popup-container').children().length <= 0) { $('.popup-container').remove(); } }, function (xhr) { } ); } function initHeader9(){ if (getCookie("header9_closed") == 1) { $(".header .header9").hide(); //hide banner $("body.live").addClass("header9_closed"); } var $top_frm=$("#main_container .body > .frm:not(.mobile_ele)").first(); if($top_frm.hasClass("headerSectionMerge")){ $("body").addClass("headerSectionMerge"); $("body").addClass("scrollBefore"); } if($("body .header").hasClass("useFixed") && !$top_frm.hasClass("headerSectionMerge")){ var body_mg_t=$(".body").css("margin-top")?$(".body").css("margin-top").replace("px",""):0; if(body_mg_t>0){ var top_frm_mg_t=$top_frm.css("margin-top")?$top_frm.css("margin-top").replace("px",""):0; if(top_frm_mg_t>0){ var cal_top_frm_mg_t=parseInt(body_mg_t)+parseInt(top_frm_mg_t); $top_frm.css("margin-top",cal_top_frm_mg_t+"px"); // console.log("top_frm mg-t:"+cal_top_frm_mg_t); } } } } function realignHeader9(){ var $top_frm=$("#main_container .body > .frm:not(.mobile_ele)").first(); if($("body .header").hasClass("useFixed") && !$top_frm.hasClass("headerSectionMerge")){ var body_mg_t=$(".body").css("margin-top")?$(".body").css("margin-top").replace("px",""):0; if(body_mg_t>0){ $top_frm.css("margin-top",$("body .header").height()+"px"); } } } function initMenu(){ var query = qv_func.getUrlParams(); if (location.pathname.indexOf('/module/board/read_form') > -1 && query.pn) { $(".header ul.mn-ul .mn-link, .header-mobile ul.mn-ul .mn-link").each(function(i,t){ if($(t).attr('href')=="/" + query.pn){ $(t).parent().addClass("cur-mn-item"); } }); } else { $(".header ul.mn-ul .mn-link, .header-mobile ul.mn-ul .mn-link").each(function(i,t){ if($(t).attr('href')=="/home"){ $(t).parent().addClass("cur-mn-item"); } }); } //$(".header ul.mn-ul .mn-link, .header-mobile ul.mn-ul .mn-link").each(function(i,t){ // if($(t).attr('href')=="///"){ // $(t).parent().addClass("cur-mn-item"); // } //}); } // 쿠키 생성 function setCookie(cName, cValue, cDay){ var expire = new Date(); expire.setDate(expire.getDate() + cDay); cookies = cName + '=' + escape(cValue) + '; path=/ '; // 한글 깨짐을 막기위해 escape(cValue)를 합니다. if(typeof cDay != 'undefined') cookies += ';expires=' + expire.toGMTString() + ';'; document.cookie = cookies; } // 쿠키 가져오기 function getCookie(cName) { cName = cName + '='; var cookieData = document.cookie; var start = cookieData.indexOf(cName); var cValue = ''; if(start != -1){ start += cName.length; var end = cookieData.indexOf(';', start); if(end == -1)end = cookieData.length; cValue = cookieData.substring(start, end); } return unescape(cValue); } $('.body').delegate('.fixed-contents-close', 'click', function(e) { $(this).parents('.fixed-contents-layer').first().remove(); }); //10.8 MAP 임시 패치