/* ¸ð¹ÙÀϸ޴º ¿­°í ´Ý±â */ function gnb_open(){ $('.gnb').animate({left:'0px'}, 300); $('.dim').height($(window).height() + 'px').fadeIn(); $('.gnb').scrollTop('0'); $('html, body, #wrap').css({ 'overflow-y':'hidden', 'height': '100%' }); return false; } function gnb_close(){ $('.gnb').animate({left:'-89%'}, 300, function() { $('#allwrap > .dim').fadeOut(); $('html, body, #wrap').css({ // 'overflow-y':'inherit', // 'height': 'auto' 'overflow-y':'', 'height': '' }); }); } // $(function() { $('.dim').on('click', function(){ $("#callNav").removeClass('active'); gnb_close(); }); }); $('.gnb .nbnbs_menulist_w a').each(function() { if (this.href.indexOf(loc, this.href.length - loc.length) != -1) { $(this).parent().addClass('current').parent().show(); if ($(this).parent().parent().parent().hasClass('ngnbs_depth')) $(this).parent().parent().parent().addClass('ngnbs_open'); } }); $('.lnb a').each(function() { if (this.href.indexOf(loc, this.href.length - loc.length) != -1) $(this).parent().addClass('on'); }); /* ¸ð¹ÙÀϸ޴º ¿­°í ´Ý±â */ $(function() { $('.ngnbs_ml_cont.ngnbs_depth').click(function() { if($(this).hasClass('ngnbs_open')) { $('.ngnbs_ml_cont.ngnbs_depth').removeClass('ngnbs_open'); } else { $('.ngnbs_ml_cont.ngnbs_depth').removeClass('ngnbs_open'); $(this).addClass('ngnbs_open'); } }); }); // ÇöÀç ¸Þ´º Ç׸ñ °­Á¶ $(function() { var loc = location.pathname + location.search; $('.gnb .menu a').each(function() { if (this.href.indexOf(loc, this.href.length - loc.length) != -1) { $(this).parent().addClass('on').parent().show(); if ($(this).parent().parent().parent().hasClass('depth')) $(this).parent().parent().parent().addClass('on'); } }); /*»õ·Î¿î GNB ¸Þ´º°­Á¶*/ $('.gnb .nbnbs_menulist_w a').each(function() { if (this.href.indexOf(loc, this.href.length - loc.length) != -1) { $(this).parent().addClass('current').parent().show(); if ($(this).parent().parent().parent().hasClass('ngnbs_depth')) $(this).parent().parent().parent().addClass('ngnbs_open'); } }); $('.lnb a').each(function() { if (this.href.indexOf(loc, this.href.length - loc.length) != -1) $(this).parent().addClass('on'); }); }); /*¸ð¹ÙÀϸ޴º¹öÆ°*/ $(function() { $("#callNav").click(function() { gnb_open(); if(!$(this).hasClass('active')) { $(this).addClass('active'); } else { $(this).removeClass('active'); gnb_close(); } }); }); /*¸ð¹ÙÀϸ޴º¹öÆ°*/ /*¿À¸¥Âʹè³Ê¹öÆ°*/ $(function() { $("#bannerbtn").click(function() { var state = $(this).data('state'); if(state == 'open') { $(this).data('state','close'); } else { $(this).data('state','open'); } if(!$(this).hasClass('active')) { $(this).addClass('active'); $("#mainBox").animate({right:"-400px"},300,"easeOutQuart") $("#bannerbtn").animate({right:"30px"},100,"easeOutQuart") $("#scrollmenu").animate({"margin-left":"0px"},300,"easeOutQuart") } else { $(this).removeClass('active'); $("#mainBox").animate({right:"0px"},300,"easeOutQuart") $("#bannerbtn").animate({right:"415px"},100,"easeOutQuart") $("#scrollmenu").animate({"margin-left":"-200px"},300,"easeOutQuart") } }); }); /*¿À¸¥Âʹè³Ê¹öÆ°*/ /* ¿À¸¥ÂÊ ¹è³Ê È°¼º Àüȯ */ $(function() { function bannerOpen() { if($("#bannerbtn").hasClass('active')) { $("#bannerbtn").removeClass('active'); $("#mainBox").stop().animate({right:"0px"},300,"easeOutQuart"); $("#bannerbtn").stop().animate({right:"415px"},100,"easeOutQuart"); $("#scrollmenu").stop().animate({"margin-left":"-200px"},300,"easeOutQuart"); } } function bannerClose() { if(!$("#bannerbtn").hasClass('active')) { $("#bannerbtn").addClass('active'); $("#mainBox").stop().animate({right:"-400px"},300,"easeOutQuart"); $("#bannerbtn").stop().animate({right:"30px"},100,"easeOutQuart"); $("#scrollmenu").stop().animate({"margin-left":"0px"},300,"easeOutQuart") } } /* À©µµ¿ì »çÀÌÁî Á¶Àý½Ã ¿À¸¥ÂÊ ¹è³Ê È°¼º Àüȯ */ $(window).resize(function() { var winWidth = $(this).width(); var state = $("#bannerbtn").data('state'); if(winWidth < 1701) { bannerClose(); } else { if(state == 'close') { return false; } bannerOpen(); } }); /* À©µµ¿ì ·Îµå½Ã 1700px ÀÌÇÏ´Â ¿À¸¥ÂÊ ¹è³Ê ºñÈ°¼ºÈ­ */ $(window).load(function() { var winWidth = $(this).width(); if(winWidth < 1701) { bannerClose(); } }); });