// PC ÇØ»óµµ ¿©ºÎ üũ ÇÔ¼ö function isPC() { var $winWidth = $(window).width(); if ($winWidth > 1024) { return true; } else { return false; } } // Çì´õ ¹× GNB °ü·Ã °øÅë ½ºÅ©¸³Æ® $(function() { var $gnb = $("#gnbWrapper"); var $gnbTrigger = $("#gnbTrigger"); var $logo = $("#logo"); // GNB ºñÈ°¼ºÈ­ function gnbdeActive() { $("#gnb > li").removeClass('open'); $("#gnb > li > ul").removeAttr('style'); $gnbTrigger.removeClass('open'); $("body").removeClass('lock'); } // GNB ¸¶¿ì½º¿À¹ö $("#gnb > li").mouseenter(function() { var $option = { 'display': 'block', 'top': '80px', 'opacity': '0' } if (isPC() === true) { if (!$(this).hasClass('on')) { $(this).addClass('on'); if ($(this).find('>ul').length > 0) { $(this).find('>ul').css($option); TweenMax.to($(this).find('ul'), 0.25, { 'opacity': 1, 'top': '67px' }); } } } }); // $("#gnb > li > ul > li").mouseenter(function() { // $(this).find('ul').stop().slideDown(300); // }); // $("#gnb > li > ul > li").mouseleave(function() { // $(this).find('ul').stop().slideUp(300); // }); $(function() { var GNB = $("#gnb > li > ul > li"); GNB.click(function(e) { if ($(this).find('> ul').hasClass('enter') === true) { e.preventDefault(); $(this).find('>ul').addClass('dropDown'); $(".dropDown").stop().slideDown(300) } else { $(".enter").removeClass('dropDown'); // $(".enter").slideUp(300); } }) }); $(function() { $("#gnb > li > a").click(function(e) { var respon1024 = $(window).width(); if (respon1024 <= 1024) { e.preventDefault(); if (!$(this).parent().hasClass('enter')) { $(this).parent().addClass('enter'); $(this).next('ul').stop().slideDown(300); } else { $(this).parent().removeClass('enter'); } } }); }); // GNB ¸¶¿ì½º¾Æ¿ô $("#gnb > li").mouseleave(function() { var $idx = $(this).index(); var $option = { 'display': '', 'top': '', 'opacity': '' } if (isPC() === true) { $(this).removeClass('on'); if ($(this).find('ul').length > 0) { TweenMax.to($(this).find('ul'), 0.25, { 'opacity': 0, 'top': '80px', onComplete: function() { $("#gnb > li").eq($idx).find('ul').css($option); } }); } } }); // GNB Ŭ¸¯ $("#gnb > li > a").click(function(e) { if (isPC() === false) { if (!$(this).parent().hasClass('open')) { if ($(this).next('ul').length > 0) { e.preventDefault(); $("#gnb > li > ul").stop().slideUp(250); $("#gnb > li").removeClass('open'); $(this).parent().addClass('open'); $(this).next('ul').stop().slideDown(350, 'easeInOutExpo'); } } else { if ($(this).next('ul').length > 0) { e.preventDefault(); $(this).parent().removeClass('open'); $(this).next('ul').stop().slideUp(250); } } } }); // ¸ð¹ÙÀϸ޴º Åä±Û¹öÆ° Ŭ¸¯ $gnbTrigger.click(function() { if (!TweenMax.isTweening($gnb)) { if (!$(this).hasClass('open')) { $(this).addClass('open'); $("body").addClass('lock'); TweenMax.to($gnb, 0.5, { left: 0, ease: Expo.easeInOut, onComplete: function() { $logo.stop().fadeIn(200); } }); } else { $(this).removeClass('open'); $("body").removeClass('lock'); TweenMax.to($gnb, 0.5, { left: '-100%', ease: Expo.easeInOut }); // $logo.stop().fadeOut(100); } } }); // À©µµ¿ì ¸®»çÀÌ¡ ó¸® $(window).bind('resize', function() { var $winWidth = $(this).width(); if ($winWidth > 1024) { $logo.removeAttr('style'); $gnb.removeAttr('style'); gnbdeActive(); } else { if (!$gnbTrigger.hasClass('open')) { $logo.removeAttr('style'); } } }); }); // À©µµ¿ì À̺¥Æ® $(window).load(function() { var elem = $(".scrollreveal"); var sty = { 'opacity': '0', 'transition': 'none' } elem.css(sty); $("html, body").animate({ scrollTop: '10' }, 10, function() { $("html, body").animate({ scrollTop: '0' }, 0); }); // ½ºÅ©·Ñ½Ã ¾Ö´Ï¸ÞÀÌ¼Ç Ã³¸® $(window).bind('scroll', function() { var winWidth = $(this).width(); var winTop = $(this).scrollTop(); var winHeight = $(this).height(); var docHeight = $(document).height(); var hdHeight = $("#header").height(); var elemHeight; var showDelay = 0; if (winWidth > 1024) { if (winTop >= hdHeight) { if (!$("#header").hasClass('fixed')) { $("#header").addClass('fixed'); $("#scrollTop").stop(true, false).fadeIn(300); } } else { $("#header").removeClass('fixed'); $("#scrollTop").stop(true, false).fadeOut(300); } } elem.each(function() { var etop = $(this).offset().top; var eh = $(this).height(); var delay = $(this).data('delay'); if (delay == null) { delay = 100; } if (winTop >= etop - winHeight) { if (!$(this).hasClass('animated')) { var aniOptions; var styR = { 'position': 'relative', 'top': '30px' } var sty = { 'top': '30px' } if ($(this).css('position') == 'static') { aniOptions = { 'opacity': '1', 'top': '0' } $(this).css(styR); } else if ($(this).css('position') == 'absolute') { aniOptions = { 'opacity': '1', } } else { aniOptions = { 'opacity': '1', 'top': '0' } $(this).css(sty); } showDelay += delay; $(this).stop().delay(showDelay).animate(aniOptions, 500, function() { var sty = { 'position': '', 'top': '', 'opacity': '', 'transition': '' } $(this).css(sty); }); $(this).addClass('animated'); } } }); }); }); // ÆäÀÌÁö ·Îµù $(window).load(function() { $("#page-loader").fadeOut(600, function() { $("#page-loader").delay(100).remove(); }); }); $(function() { // ½ºÅ©·Ñ ¹öÆ° À̺¥Æ® $("#scrollTop").bind('mouseenter mouseleave click', function(e) { if (e.type === 'mouseenter') { if (!$(this).hasClass('on')) { $(this).addClass('on'); } } else if (e.type === 'click') { $("html, body").stop().animate({ scrollTop: '0' }, 500, 'easeInOutExpo'); } else { $(this).removeClass('on'); } }) }); // Æû¸ÞÀÏ placehold Ãß°¡ $(function() { if ($(".tbl_formmail").length > 0) { var $form = $(".tbl_formmail"); $form.find('input[name=name]').attr('placeholder', 'Name'); $form.find('input[name=title]').attr('placeholder', 'Phone'); $form.find('input[name=receiver_email]').attr('placeholder', 'Email'); $form.find('textarea[name=description]').attr('placeholder', 'Message'); } });