$(function(){ tl = TweenMax; //fullpage $('#fullpage').fullpage({ navigation: true, slidesToSections: true, navigationPosition: 'right', showActiveTooltip:true, scrollingSpeed: 750, // ** 페이지를 불러온 후 afterLoad : function(anchorLink, index){ //active class $('.sec'+index).addClass('ani'); $('header,#fp-nav,.scroll_top_wrap').stop(true).fadeIn(); if(index != 1){ $('.scroll_top_wrap').removeClass('down_btn'); $('.scroll_top_wrap').addClass('top_btn'); $('.scroll_top_wrap .icon').text('TOP'); }else{ $('.scroll_top_wrap .icon').text('SCROLL'); $('.scroll_top_wrap').removeClass('top_btn'); $('.scroll_top_wrap').addClass('down_btn'); } if(index == 6){ $('header,#fp-nav,.scroll_top_wrap').stop(true).fadeOut(100); }else{ $('header,#fp-nav,.scroll_top_wrap').stop(true).fadeIn(); } }, // ** 페이지를 떠날때 onLeave : function(anchorLink, destination, direction, index){ //active class $('#side_nav li').removeClass('on'); $('#side_nav li:nth-child('+destination+')').addClass('on'); if($('.sec'+destination).hasClass('dark')){ $('body').addClass('dark'); $('header').addClass('dark'); }else{ $('body').removeClass('dark'); $('header').removeClass('dark'); } $('header,#fp-nav,.scroll_top_wrap').stop(true).fadeOut(100); if(anchorLink == 1 && direction =='down'){ $('#fp-nav').addClass('act'); } if(anchorLink == 2 && direction =='up'){ $('#fp-nav').removeClass('act'); } }, }); //top button $('.scroll_top_wrap').click(function() { if($(this).hasClass('down_btn')){ $.fn.fullpage.moveTo(2); }else{ $.fn.fullpage.moveTo(1); } }); //side dot nav $(document).on('click',' #fp-nav li:first-child ', function () { $('#fp-nav').removeClass('act'); }); //메인비쥬얼 모바일 높이 대응 function resetHeight(){ $('.main_home').css('height', $(window).innerHeight()); } window.addEventListener("resize", resetHeight); resetHeight(); var mainSlider = new Swiper('.main_slider', { speed:900, loop:true, effect: "slide", parallax: true, autoplay: { delay:3500, disableOnInteraction: false, }, fadeEffect: { crossFade: false, }, mousewheel: false, navigation: { prevEl: '.main_home .arrow_prev', nextEl: '.main_home .arrow_next', }, pagination: { el: ".main_home .dot", clickable: true, }, watchSlidesVisibility: true, on: { init: function () { }, transitionStart: function () { var secNum = this.activeIndex; }, transitionEnd: function () { var secNum = this.activeIndex +1; }, }, }); //media $('.info_list .item:first-child').addClass('active'); var mediaSwiper = new Swiper(".media_slider", { speed:900, loop:false, effect: "fade", slidesPerView: 1, navigation: { nextEl: ".media_info .arrow_next", prevEl: ".media_info .arrow_prev", }, on: { transitionStart: function () { var secNum = this.activeIndex; $('.info_list .item').removeClass('active'); $('.info_list .item:eq('+secNum+')').addClass('active'); }, }, }); //news var newsSwiper = new Swiper(".news_slider", { speed:900, loop:true, effect: "slide", slidesPerView: 3, autoplay: { delay:5000, disableOnInteraction: false, }, navigation: { nextEl: ".news_wrap .arr_next", prevEl: ".news_wrap .arr_prev", }, breakpoints: { 1279: { slidesPerView:'auto' }, }, }); var solveSlider = $('.solve_list'); var solveSlickOptions = { speed: 700, slidesToShow: 1, variableWidth: true, infinite: false, arrows: false, touchMove:true, swipe:true, }; $(window).on('load resize', function() { if($(window).width() > 1279) { solveSlider.filter('.slick-initialized').slick('unslick'); }else{ solveSlider.not('.slick-initialized').slick(solveSlickOptions); } }); if($(window).width() > 1279) { solveSlider.filter('.slick-initialized').slick('unslick'); }else{ solveSlider.not('.slick-initialized').slick(solveSlickOptions); } });