// PC ÇØ»óµµ ¿©ºÎ üũ ÇÔ¼ö function isPC() { var $winWidth = $(window).width(); if($winWidth > 1024) { return true; } else { return false; } } $(function() { // Synchronize lnb height function syncNav() { var wSize = $(window).width(); if(wSize > 1024) { var bh = $("#container").height(); $("#header").css('height', bh + 'px'); } else { $("#header").removeAttr('style'); } } // Active Sub navigation function activeSub() { var mnuIndex = $("#container").data('menu'); var subIndex = $("#container").data('sub'); var snb = $("#snb li"); var subNav = $("#subnav ul.sub"); var nDepth = $("#subnav ul.sub li"); snb.each(function() { if($(this).index() === mnuIndex - 1) { $(this).addClass('on'); } }); subNav.each(function() { if($(this).index() === mnuIndex - 1) { $(this).css('display','block'); } }); nDepth.each(function() { if($(this).parent('.sub').index() === mnuIndex - 1 && $(this).index() === subIndex - 1) { $(this).addClass('active'); } }); } $("#snb li").mouseenter(function() { var $index = $(this).index(); $("#snb li").removeClass('on'); $(this).addClass('on'); if($("body").hasClass('main')) { if(!$("#subnav").hasClass('active')) { $("#subnav").addClass('active'); $("#subnav").stop(true,false).animate({opacity:0}, 0); $("#subnav").stop(true,false).animate({opacity:1, left:'200px'}, 400); } } $("#subnav ul.sub").css({display:'none'}); $("#subnav ul.sub").eq($index).css({display:'block'}); }); $("#subnav").mouseleave(function() { if($("body").hasClass('main')) { $("#snb li").removeClass('on'); $("#subnav").removeClass('active'); $("#subnav").stop(true,false).animate({opacity:0, left:'0'}, 400, function() { $("#subnav ul.sub").css({display:'none'}); }); } }); $("#mnav_call").click(function() { var $height = $("html").height(); var $winSize = $(window).width(); if(!$("#wrap").is(':animated')) { if(!$(this).hasClass('active')) { $(this).addClass('active'); $("#mnav").css('height',$height + 'px'); if($winSize > 640) { $("#wrap").stop(true, false).delay(300).animate({left:'35%'}, 400); } else { $("#wrap").stop(true, false).delay(300).animate({left:'50%'}, 400); } } else { $(this).removeClass('active'); $("#wrap").stop(true, false).delay(300).animate({left:0}, 400); } } }); $("#mnav ul.depth1 > li").click(function() { if($(this).hasClass('open')) { $(this).removeClass('open'); $(this).find('.depth2').stop(true,false).slideUp(300); } else { $("#mnav ul.depth1 > li").removeClass('open'); $(this).addClass('open'); $("#mnav ul.depth2").stop(true,false).slideUp(300); $(this).find('.depth2').stop(true,false).slideDown(300); } }); $(".family > a").click(function() { if(!$(this).siblings('.dropdown').is(':visible')) { $(this).siblings('.dropdown').stop(true,false).slideDown(700); } else { $(this).siblings('.dropdown').stop(true,false).slideUp(700); } }); activeSub(); $(window).resize(function() { syncNav(); }); $(window).load(function() { syncNav(); }); }); // Products Fade $(function() { var pIndex = 0; var pTimer; function productInit() { if($("#productFade").length > 0) { var pCount = $("#productFade ul.imgList li").length; var html = "
  • "; var i; $("#productFade ul.imgList li:last").after($("#productFade ul.imgList li[data-index=0]")); for(i=1; i<=pCount; i++) { $("#productFade ul.pagination").append(html); } $("#productFade ul.pagination li:first").addClass('on'); } } function productFade() { var count = $("#productFade ul.imgList li").length; pIndex++; if(pIndex>=count) { pIndex = 0 } $("#productFade ul.pagination li").removeClass('on'); $("#productFade ul.pagination li").eq(pIndex).addClass('on'); $("#productFade ul.imgList li").removeClass('active'); $("#productFade ul.imgList li:last").after($("#productFade ul.imgList li[data-index=" + pIndex + "]")); $("#productFade ul.imgList li[data-index=" + pIndex + "]").addClass('active'); $("#productFade ul.imgList li[data-index=" + pIndex + "]").stop(true,false).animate({opacity:0}, 0); $("#productFade ul.imgList li[data-index=" + pIndex + "]").stop(true,false).animate({opacity:1}, 800); } $(document).on('click', '#productFade ul.pagination li', function() { var idx = $(this).index(); if(!$("#productFade ul.imgList li").is(':animated')) { $("#productFade ul.imgList li").stop(); clearInterval(pTimer); pTimer = setInterval(function() { productFade(); }, 8000); pIndex = idx-1; productFade(); return false; } }); $("#productFade .pause").click(function() { clearInterval(pTimer); }); pTimer = setInterval(function() { productFade(); }, 8000); productInit(); }); // Latest board tab $(function() { $("#aside .latest_box ul.tab li").click(function() { var idx = $(this).index(); $("#aside .latest_box .tab_content").css('display','none'); $("#aside .latest_box .tab_content").eq(idx).css('display','block'); $("#aside .latest_box ul.tab li").removeClass('on'); $(this).addClass('on'); }); }); // Promotional Video Layer Popup $(function() { $("#aside .video_box").click(function() { var wHeight = $(window).height(); if(!$("#videolayer").is(':visible')) { $("#mask").css('display','block'); $("#videolayer").html(''); $("#videolayer").html(''); $("#videolayer iframe").load(function() { $("#videolayer").css({top:(wHeight / 5) + 'px', display:'block'}); }); } }); $("#mask").click(function(e) { if($("#videolayer").is(':visible')) { $(this).css('display','none'); $("#videolayer").css('display','none'); } }); }); // Location page $(function() { var popIndex = 0; var popCount = $("#imgPopup .img_wrap ul li").length; function popImgFade() { if(popIndex < 0) { popIndex = popCount - 1; } else if(popIndex >= popCount) { popIndex = 0; } var imgTitle = $("#imgPopup .img_wrap ul li").eq(popIndex).find('img').attr('alt'); console.log(popIndex); $("#imgPopup .img_wrap ul li").removeClass('on'); $("#imgPopup .img_wrap ul li").eq(popIndex).css({opacity:0}); $("#imgPopup .img_wrap ul li").stop(true,true).eq(popIndex).animate({opacity:1}, 500, 'easeOutCubic'); $("#imgPopup .img_wrap ul li").eq(popIndex).addClass('on'); $("#imgPopup p.tit").text(imgTitle); } $("#img_popup_wrap .pop_prev").click(function() { popIndex--; popImgFade(); }); $("#img_popup_wrap .pop_next").click(function() { popIndex++; popImgFade(); }); $("#img_popup_wrap .pop_close").click(function() { $("#img_popup_wrap").css({visibility:'hidden'}); }); $("#photo_list li").click(function() { var idx = $(this).index(); var pop_w = ($(window).width() - $("#imgPopup").width()) / 2; var pop_h = ($(window).height() - $("#imgPopup").height()) / 2; popIndex = idx; $("#img_popup_wrap").css({display:'block', visibility:'visible'}); $("#imgPopup").css({left:pop_w + 'px', top:pop_h + 'px'}); popImgFade(); }); }); $(function() { var photoIndex = 1; var swipeIndex = 0; if($("#photo_swipe").length > 0) { var wSize = $("#photo_swipe").width(); var count = $("#photo_swipe ul li").length; $("#photo_swipe ul").css({width:wSize * count + 'px'}); $("#photo_swipe ul li").css({width:wSize+'px'}); } function slide_resize(img) { var zh = 64; var vh = (img.height() - zh) / 2; img.find('.zoom').css({top:vh + 'px'}); } function slide_init() { var pcount = Math.ceil($("#photo_list li").length / 4); var mcount = $("#photo_swipe ul li").length; $("#container .company .photo_slide .paging span.all").text(pcount); $("#container .company .photo_slide .paging_m span.all").text(mcount); } function photo_slide() { var count = Math.ceil($("#photo_list li").length / 4); var mcount = $("#photo_swipe ul li").length; var imgSize = $("#photo_swipe ul li:first").width(); if(photoIndex<1) { photoIndex = 1; } else if(photoIndex>count) { photoIndex = count; } else { $("#photo_list li").css({display:'none'}); $("#photo_list li.page" + photoIndex).css({display:'block'}); $("#container .company .photo_slide .paging span.current").text(photoIndex); } } function swipe_left() { var imgSize = $("#photo_swipe ul li:first").width(); var mcount = $("#photo_swipe ul li").length; if(swipeIndex<0) { swipeIndex = mcount - 1; } $("#photo_swipe ul").css({left:-imgSize+'px'}); $("#photo_swipe ul li:first").before($("#photo_swipe ul li:last")); $("#photo_swipe ul").stop(true,false).animate({left:0}, 300, 'easeOutCubic', function() { $("#container .company .photo_slide .paging_m span.current").text(swipeIndex+1); }); } function swipe_right() { var imgSize = $("#photo_swipe ul li:first").width(); var mcount = $("#photo_swipe ul li").length; if(swipeIndex>=mcount) { swipeIndex = 0; } $("#photo_swipe ul").stop(true,false).animate({left:-(imgSize) + 'px'}, 300, 'easeOutCubic', function() { $("#photo_swipe ul li:last").after($("#photo_swipe ul li:first")); $("#photo_swipe ul").css({left:0}); $("#container .company .photo_slide .paging_m span.current").text(swipeIndex+1); }); } $("#photo_prev").click(function() { photoIndex--; photo_slide(); }); $("#photo_next").click(function() { photoIndex++; photo_slide(); }); $("#photo_prev_m").click(function() { if(!$("#photo_swipe > ul").is(':animated')) { swipeIndex--; swipe_left(); } }); $("#photo_next_m").click(function() { if(!$("#photo_swipe > ul").is(':animated')) { swipeIndex++; swipe_right(); } }); if($("#photo_swipe").length > 0) { $("#photo_swipe").swipe({ swipe:function(event, direction, distance, duration, fingerCount, fingerData) { if(direction == "left"){ swipeIndex++; swipe_right(); } else if(direction == "right"){ swipeIndex--; swipe_left(); threshold:0 } } }); } $("#photo_list li").mouseenter(function() { $(this).find('a').css({display:'block'}); slide_resize($(this)); }).mouseleave(function() { $(this).find('a').css({display:'none'}); }); slide_init(); }); // Text underline animation effect $(function() { function textEffect() { $("ul.text_effect p .color1").stop(true,false).animate({width:'100%'}, 1000, 'easeInOutCubic', function() { $("ul.text_effect p .color2").stop(true,false).animate({width:'100%'}, 1000, function() { $("ul.text_effect p .color1").css({width:0}); $("ul.text_effect p .color2").css({width:0}); textEffect(); }); }); } if($("ul.text_effect").length > 0) { textEffect(); } }); // On window resizing, photo swipe slider resize $(window).resize(function() { if($("#photo_swipe").length > 0) { var wSize = $("#photo_swipe").width(); var count = $("#photo_swipe ul li").length; $("#photo_swipe ul").css({width:wSize * count + 'px', left:0}); $("#photo_swipe ul li").css({width:wSize + 'px'}); } if($("#imgPopup").length > 0) { var pop_w = ($(window).width() - $("#imgPopup").width()) / 2; var pop_h = ($(window).height() - $("#imgPopup").height()) / 2; $("#imgPopup").css({left:pop_w + 'px', top:pop_h + 'px'}); } }); // Æ÷Åä°¶·¯¸® Ä¿½ºÅ͸¶ÀÌ¡ $(function() { var subject = new Array(); // °¶·¯¸® ½æ³×ÀÏ Á¦¸ñ ¹è¿­º¯¼ö ¼±¾ð var content = new Array(); // °¶·¯¸® ½æ³×ÀÏ ³»¿ë ¹è¿­º¯¼ö ¼±¾ð var url = new Array(); // °¢ ½æ³×ÀϺ° ¸µÅ© ÀúÀå¿ë º¯¼ö var thumbCount; // ½æ³×ÀÏ °³¼ö (ÃßÃâ°³¼ö) var refHeight; // ³ôÀÌ µ¿±âÈ­¸¦ À§ÇÑ º¯¼ö // °¶·¯¸® Ãʱ⼼Æà function galleryInit() { if($(".bbsnewf5").length > 0) { thumbCount = $(".brd_photo_list .bbsnewf5").length; if($(".hoverBox").length > 0) { $(".hoverBox").parent('a').remove(); } for(i=0; i

    ' + subject[i] + '

    ' + $.trim(content[i]) + '

    '); } // ±âÁ¸¿¡ º¸¿©Áö´Â º°µµ td ÀÇ Á¦¸ñ, ³»¿ëÀº ¼û±è $(".gallery_subject, .gallery_etc").css('display','none'); } } galleryInit(); }); // °Ô½ÃÆÇ Ä«Å×°í¸® ÅÇ (2017-08-08 Ãß°¡) $(function() { // Ä«Å×°í¸® °ü·Ã º¯¼ö ¼±¾ð var cate_link = [], cate_title = [], currentURL = $(location).attr('pathname'), param = "?&com_board_category_code=", currentParam = "", insertHTML = "", idx = 0; // ÆĶó¸ÞÅÍ °ª °¡Á®¿À±â var getUrlParameter = function getUrlParameter(sParam) { var sPageURL = decodeURIComponent(window.location.search.substring(1)), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : sParameterName[1]; } } }; // ¼¿·ºÆ®¹Ú½º ¸µÅ©È­ if($("select[name='com_board_category_code']").length > 0) { currentParam = getUrlParameter('com_board_category_code'); $("select[name='com_board_category_code'] > option").each(function() { cate_link[idx] = $(this).val(); cate_title[idx] = $(this).text(); idx++; }); insertHTML = '
    '; insertHTML += '' + cate_title[0] + ''; insertHTML += ''; insertHTML += '
    '; $(".cate_select").before(insertHTML); $.each(cate_link, function(m, key) { if(key == currentParam) { $(".board_tab > a").text(cate_title[m]); $(".board_tab > ul > li[data-category='" + key + "']").addClass('on'); } }); if(!currentParam) { $(".board_tab > ul > li:first").addClass('on'); } } // Ä«Å×°í¸® ¸µÅ© Ŭ¸¯½Ã $(document).on('click', '.board_tab > a', function() { if(!isPC()) { if(!$(this).hasClass('open')) { $(this).addClass('open'); $(this).next('ul').css('display','block'); } else { $(this).removeClass('open'); $(this).next('ul').css('display','none'); } } }); // À©µµ¿ì ¸®»çÀÌ¡ ó¸® (Ä«Å×°í¸® Ç׸ñ enable/disable) $(window).bind('resize', function() { if(isPC() && $(".board_tab").length > 0) { $(".board_tab > ul").css('display','block'); } else if(!isPC()) { if(!$(".board_tab > a").hasClass('open')) { $(".board_tab > ul").css('display','none'); } } }); });