$(function() { // ÁÂÃø¸Þ´º, ÄÁÅÙÃ÷ ³ôÀÌ µ¿±âÈ­ function syncNav() { var wSize = $(window).width(); if(wSize > 1024) { var bh = $("#container").height(); $("#header").css('height', bh + 'px'); } else { $("#header").removeAttr('style'); } } // ¼­ºê¸Þ´º È°¼ºÈ­ 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(); }); }); // ¼­ºêÆäÀÌÁö ¿ìÃø °øÅë ½½¶óÀ̵å $(function() { var subIndex = 0; var subCount = $("#sub_aside ul.imgList li").length; function subSlide() { var subWidth = $("#sub_aside ul.imgList li:first").width(); if(subIndex<0) { subIndex = subCount - 1; } else if (subIndex>=subCount) { subIndex = 0; } $("#sub_aside ul.imgList").stop(true,false).animate({left:-(subIndex*subWidth) + 'px'}, 400); } function subInit() { var wSize = $(window).width(); var barWidth = ($(window).width() * 0.37) - 200; var conWidth = $("#container .inner").width(); if(wSize > 1024 && wSize < 1281) { var liSize = conWidth + 100; $("#sub_aside ul.imgList li").css('width',liSize + 'px'); $("#sub_aside ul.imgList").css('left',-(subIndex*liSize) + 'px'); } else if(wSize < 1025) { $("#sub_aside ul.imgList li").css('width',wSize + 'px'); $("#sub_aside ul.imgList").css('left',-(subIndex*wSize) + 'px'); } else { $("#sub_aside ul.imgList li").css('width',barWidth + 'px'); $("#sub_aside ul.imgList").css('left',-(subIndex*barWidth) + 'px'); } } $("#sub_aside .prev").click(function() { if(!$("#sub_aside ul.imgList").is(':animated')) { subIndex--; subSlide(); } }); $("#sub_aside .next").click(function() { if(!$("#sub_aside ul.imgList").is(':animated')) { subIndex++; subSlide(); } }); $(window).load(function() { subInit(); }); $(window).resize(function() { subInit(); }); }); // ºñµð¿À ·¹À̾î Æ˾÷ $(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'); } }); }); // ã¾Æ¿À½Ã´Â±æ ÆäÀÌÁö Æ˾÷ ó¸® $(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(); }); // ÅؽºÆ® ¾ð´õ¶óÀÎ ÀÌÆåÆ® $(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(); } }); // À©µµ¿ì ¸®»çÀÌ¡½Ã ã¾Æ¿À½Ã´Â ±æ À̹ÌÁö ½½¶óÀÌµå »çÀÌÁî ¸ÂÃã $(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'}); } });