;(function () { // animate-box /*var contentWayPoint = function() { $('.animate-box').waypoint( function( direction ) { if( direction === 'down' && !$(this).hasClass('animated') ) { $(this.element).addClass('fadeInUp animated'); } } , { offset: '75%' } ); };*/ // Burger Menu var burgerMenu = function() { $('body').on('click', '.js-fh5co-nav-toggle', function(event){ if ( $('#navbar').is(':visible') ) { $(this).removeClass('active'); } else { $(this).addClass('active'); } event.preventDefault(); }); }; // Reflect scrolling in navigation var navActive = function(section) { var $el = $('#navbar > ul'); $el.find('li').removeClass('active'); $el.each(function(){ $(this).find('a[data-nav-section="'+section+'"]').closest('li').addClass('active'); }); }; // Window Scroll var windowScroll = function() { var lastScrollTop = 0; $(window).scroll(function(event){ var header = $('#fh5co-header'), scrlTop = $(this).scrollTop(); if ( scrlTop > 500 && scrlTop <= 2000 ) { header.addClass('navbar-fixed-top fh5co-animated slideInDown'); } else if ( scrlTop <= 500) { if ( header.hasClass('navbar-fixed-top') ) { header.addClass('navbar-fixed-top fh5co-animated slideOutUp'); setTimeout(function(){ header.removeClass('navbar-fixed-top fh5co-animated slideInDown slideOutUp'); }, 100 ); } } }); }; // Animations // About Us var aboutAnimate = function() { if ( $('#about-us').length > 0 ) { $('#about-us .to-animate').each(function( k ) { var el = $(this); setTimeout ( function () { el.addClass('fadeInUp animated'); }, k * 200, 'easeInOutExpo' ); }); } }; // Team var teamAnimate = function() { if ( $('#team').length > 0 ) { $('#team .to-animate').each(function( k ) { var el = $(this); setTimeout ( function () { el.addClass('fadeInUp animated'); }, k * 200, 'easeInOutExpo' ); }); } }; var teamWayPoint = function() { if ( $('#team').length > 0 ) { $('#team').waypoint( function( direction ) { if( direction === 'down' && !$(this).hasClass('animated') ) { setTimeout(teamAnimate, 200); $(this.element).addClass('animated'); } } , { offset: '95%' } ); } }; // Services var servicesAnimate = function() { if ( $('#fh5co-our-services').length > 0 ) { $('#fh5co-our-services .to-animate').each(function( k ) { var el = $(this); setTimeout ( function () { el.addClass('fadeInUp animated'); }, k * 200, 'easeInOutExpo' ); }); } }; var servicesWayPoint = function() { if ( $('#fh5co-our-services').length > 0 ) { $('#fh5co-our-services').waypoint( function( direction ) { if( direction === 'down' && !$(this).hasClass('animated') ) { setTimeout(servicesAnimate, 200); $(this.element).addClass('animated'); } } , { offset: '95%' } ); } }; // Features var featuresAnimate = function() { if ( $('#fh5co-features').length > 0 ) { $('#fh5co-features .to-animate').each(function( k ) { var el = $(this); setTimeout ( function () { el.addClass('fadeInUp animated'); }, k * 200, 'easeInOutExpo' ); }); } }; var featuresWayPoint = function() { if ( $('#fh5co-features').length > 0 ) { $('#fh5co-features').waypoint( function( direction ) { if( direction === 'down' && !$(this).hasClass('animated') ) { setTimeout(function(){ $('.animate-features-1').addClass('animated fadeIn'); }, 100); setTimeout(function(){ $('.animate-features-2').addClass('animated fadeIn'); }, 200); setTimeout(featuresAnimate, 500); setTimeout(function(){ $('.animate-features-3').addClass('animated fadeInUp'); }, 1400); $(this.element).addClass('animated'); } } , { offset: '95%' } ); } }; // testimonials var testimonialsAnimate = function() { if ( $('#fh5co-testimonials').length > 0 ) { $('#fh5co-testimonials .to-animate').each(function( k ) { var el = $(this); setTimeout ( function () { el.addClass('fadeInUp animated'); }, k * 200, 'easeInOutExpo' ); }); } }; var testimonialsWayPoint = function() { if ( $('#fh5co-testimonials').length > 0 ) { $('#fh5co-testimonials').waypoint( function( direction ) { setTimeout(testimonialsAnimate, 200); $(this.element).addClass('animated'); } , { offset: '95%' } ); } }; // Pricing var pricingAnimate = function() { if ( $('#fh5co-pricing').length > 0 ) { $('#fh5co-pricing .to-animate').each(function( k ) { var el = $(this); setTimeout ( function () { el.addClass('fadeInUp animated'); }, k * 200, 'easeInOutExpo' ); }); } }; var pricingWayPoint = function() { if ( $('#fh5co-pricing').length > 0 ) { $('#fh5co-pricing').waypoint( function( direction ) { setTimeout(function(){ $('.animate-pricing-1').addClass('animated fadeIn'); }, 200); setTimeout(function(){ $('.animate-pricing-2').addClass('animated fadeIn'); }, 300); setTimeout(pricingAnimate, 700); $(this.element).addClass('animated'); } , { offset: '95%' } ); } }; // Pricing var pressAnimate = function() { if ( $('#fh5co-press').length > 0 ) { $('#fh5co-press .to-animate').each(function( k ) { var el = $(this); setTimeout ( function () { el.addClass('fadeInUp animated'); }, k * 200, 'easeInOutExpo' ); }); } }; var pressWayPoint = function() { if ( $('#fh5co-press').length > 0 ) { $('#fh5co-press').waypoint( function( direction ) { setTimeout(function(){ $('.animate-press-1').addClass('animated fadeIn'); }, 200); setTimeout(function(){ $('.animate-press-2').addClass('animated fadeIn'); }, 300); setTimeout(pressAnimate, 700); $(this.element).addClass('animated'); } , { offset: '95%' } ); } }; // Document on load. $(function(){ burgerMenu(); windowScroll(); teamWayPoint(); servicesWayPoint(); featuresWayPoint(); testimonialsWayPoint(); pricingWayPoint(); pressWayPoint(); }); }()); /*** º¹¸®ÈÄ»ý ***/ $(document).ready(function(){ $ ( ".sub5_box_wrap"). hover (function () { $ (this) .animate ({top : "-20"}, {queue : false}); if ($(window).width() < 768) { $ (this) .animate ({top : "0"}, {queue : false}); } }, function () { $ (this) .animate ({top : "0"}, {queue : false}); }); }); /*** ¸ÞÀιè³Ê ***/ $(document).ready(function(){ $('#quick2 .left_btn .open').click( function(){ $('.quick_wrap').animate({right:'0'},500,'easeInOutCubic'); $(this).addClass('hit'); $('#quick2 .left_btn .close').removeClass('hit'); $.cookie('quickey2' , 'open', {path:'/'}); }); $('#quick2 .left_btn .close').click( function(){ $('.quick_wrap').animate({right:'-330'},500,'easeInOutCubic'); $(this).addClass('hit'); $('#quick2 .left_btn .open').removeClass('hit'); $.cookie('quickey2' , 'close', {path:'/'}); }); }); /*** ¸ð¹ÙÀÏ ¸ÞÀιè³Ê ***/ $(document).ready(function(){ $('#m_quick2 .left_btn .open').click( function(){ $('.m_quick_wrap').animate({right:'0'},500,'easeInOutCubic'); $(this).addClass('hit'); $('#m_quick2 .left_btn .close').removeClass('hit'); $.cookie('m_quickey2' , 'open', {path:'/'}); }); $('#m_quick2 .left_btn .close').click( function(){ $('.m_quick_wrap').animate({right:'-250'},500,'easeInOutCubic'); $(this).addClass('hit'); $('#m_quick2 .left_btn .open').removeClass('hit'); $.cookie('m_quickey2' , 'close', {path:'/'}); }); }); $(function(){ initSimpleBanner(); }); /** * initializes SimpleBanners */ function initSimpleBanner(){ var wrap; var W; var H; var lis; var li; var nav_wrap; var nav_ul; var cnt; var i; var itv; var type; var nav_type; $(".simple_banner_wrap").each(function(idx){ // init variables wrap = $(this); wrap.data("index", idx); wrap.data("current", 0); wrap.data("mouseenter", false); W = wrap.width(); H = wrap.height(); switch(wrap.data("type")){ case "hslide": case "vslide": case "alpha": type = wrap.data("type"); break; default: wrap.data("type", "alpha"); type = "alpha"; break; } switch(wrap.data("nav-type")){ case "numeral": case "bullet": case "prev_next": nav_type = wrap.data("nav-type"); break; default: wrap.data("nav-type", "bullet"); nav_type = "bullet"; break; } if(isNaN(wrap.data("interval"))){ wrap.data("interval", 3000); } lis = wrap.find("ul li"); cnt = lis.length; wrap.data("total", cnt); // init banners if(type == "hslide"){ lis.each(function(idx, itm){ li = $(itm); li.css("left", W * idx + "px"); }); }else if(type == "vslide"){ lis.each(function(idx, itm){ li = $(itm); li.css("top", H * idx + "px"); }); }else{ lis.each(function(idx, itm){ li = $(itm); if(idx == 0){ li.css({zIndex:1, opacity:1}); }else{ li.css("opacity", 0); } }); } // init navigation wrap.append(''); nav_wrap = wrap.find(".nav_wrap"); nav_ul = wrap.find(".nav_wrap ul"); switch(nav_type){ case "numeral": case "bullet": for(i=0; i'+(i+1)+''); } nav_ul.find("li").bind("click", sbNavClickListener); nav_ul.find("li").eq(0).addClass("on"); break; case "prev_next": nav_ul.append('
  • <
  • '); nav_ul.append('
  • >
  • '); nav_ul.find("li").bind("click", sbNavClickListener); break; } nav_wrap.css("left", (W - nav_wrap.width())/2 + "px" ); // rest timer i = idx; itv = wrap.data("interval"); setTimeout("sbAnimateBannerTimer("+i+")", itv); // init events wrap.bind("mouseenter", sbMouseEnterListener); wrap.bind("mouseleave", sbMouseLeaveListener); }); } /** * mouse enter listener * kill timer on mouse enter */ function sbMouseEnterListener(e){ var wrap = $(e.currentTarget); wrap.data("mouseenter", true); if(wrap.data("stid")){ clearTimeout(wrap.data("stid")); } } /** * mouse leave listener * reset timer on mouse leave */ function sbMouseLeaveListener(e){ var wrap = $(e.currentTarget); wrap.data("mouseenter", false); var n = wrap.data("index"); var itv = wrap.data("interval"); wrap.data("stid", setTimeout("sbAnimateBannerTimer("+n+")", itv)); } /** * timer callback function */ function sbAnimateBannerTimer(idx){ var wrap = $(".simple_banner_wrap").eq(idx); //console.log("timeout", idx, wrap.data("current"), wrap.data("total"), wrap.data("stid")); var c = wrap.data("current") + 1; if(c >= wrap.data("total")){ c = 0; } sbAnimateBanner(wrap, c); } /** * navigation click listener */ function sbNavClickListener(e){ var n; var nav = $(e.target); var wrap = nav.parents(".simple_banner_wrap"); switch(wrap.data("nav-type")){ case "numeral": case "bullet": n = nav.html() - 1; break; case "prev_next": var total = wrap.data("total"); n = wrap.data("current"); if(nav.html() == "<"){ n--; if(n < 0){ n = total - 1; } }else{ n++; if(n >= total){ n = 0; } } break; } sbAnimateBanner(wrap, n); } /** * animates banners */ function sbAnimateBanner(wrap, cur){ // kill timer if(wrap.data("stid")){ clearTimeout(wrap.data("stid")); } // init variables wrap.data("current", cur); var type = wrap.data("type"); var W = wrap.width(); var H = wrap.height(); var wrap_ul = wrap.children("ul"); var wrap_lis = wrap_ul.children(); var nav_li; // animate banner if(type == "hslide"){ wrap_ul.stop(true); wrap_ul.animate({left:-W*cur+"px"}, 200); }else if(type == "vslide"){ wrap_ul.stop(true); wrap_ul.animate({top:-H*cur+"px"}, 200); }else{ var li; wrap_lis.each(function(idx, itm){ li = $(itm); li.stop(true); if(idx == cur){ li.css("z-index", 1); li.animate({opacity:1}, 200); }else{ li.css("z-index", 0); li.animate({opacity:0}, 200); } }); } // update navigation switch(wrap.data("nav-type")){ case "numeral": case "bullet": wrap.find(".nav_wrap ul li").each(function(idx, itm){ nav_li = $(itm); if(idx == cur){ nav_li.addClass("on"); }else{ nav_li.removeClass("on"); } }); break; //case "prev_next": // do nothing //break; } // reset timer if(wrap.data("mouseenter") == false){ var n = wrap.data("index"); var itv = wrap.data("interval"); wrap.data("stid", setTimeout("sbAnimateBannerTimer("+n+")", itv)); } } $(function(){ $(".kakao_m").hover(function(){ $(".kakao_m .kakao_btn").addClass("hover"); $(".kakao_m .kakao_btn_on").addClass("hover2"); }, function(){ $(".kakao_m .kakao_btn").removeClass("hover"); $(".kakao_m .kakao_btn_on").removeClass("hover2"); }); });