$(function(){ $("body").addClass("intro"); $("body").addClass("motion"); $("#wrap header").on("transitionend", function(){ $("body").removeClass("motion"); }); // 레이어팝업 var bg = $("#bg"); $(document).on('click',' #bg, .close ', function () { bg.fadeOut(); $('#video-popup div.inner').html(''); $('#video-popup').hide(); }); $('.play_btn').on('click', function(){ $("#bg,.video_pop").show(); }); $('.video_pop .close_btn,#bg').on('click', function(){ $("#bg,.video_pop").hide(); }); $(window).resize(function(){ var footerHgt = document.getElementById('footer').offsetHeight + 10; $('.footer_sec').css( "height", ""+(footerHgt)+"px" ); }).resize(); var fullSlide = new Swiper('.full_slide', { slidesPerView: 'auto', direction: "vertical", effect: "slide", autoplay: false, slidesPerView: 'auto', speed:900, parallax: true, mousewheel: { releaseOnEdges: true }, allowTouchMove:false, simulateTouch:false, grabCursor: false, touchStartPreventDefault:false, mousewheelControl: true, watchSlidesProgress: true, watchSlidesVisibility: true, pagination: { el: '.full_pagination', clickable: true, }, on:{ init: function(){ $('.scroll_btn').addClass('down'); }, transitionStart : function (){ if($('#section.bk').hasClass('swiper-slide-active')){ $('body').addClass('bk'); }else{ $('body').removeClass('bk'); } if(this.activeIndex == 0){ $('.scroll_btn').addClass('down'); $('.scroll_btn').removeClass('top'); }else { $('.scroll_btn').addClass('top'); $('.scroll_btn').removeClass('down'); } if(this.activeIndex == 2){ $(".section03").addClass("on"); } if(!$(".full_slide #section:last-child").hasClass("swiper-slide-visible")){ $("#wrap").removeClass("foot_act"); $(".scroll_btn").fadeIn(); $(".full_pagination ").fadeIn(); }else{ $(".scroll_btn").fadeOut(); $(".full_pagination ").fadeOut(); } }, }, breakpoints:{ 1279:{ allowTouchMove:true, simulateTouch:true, grabCursor: true, touchStartPreventDefault:true, }, }, }); fullSlide.on('transitionStart', function() { if( fullSlide.activeIndex == 1 ){ // parallax motion bug fix if( $('html').hasClass('ie') ) { $('.section01 .inner_g').css({'transform': 'translate(0px, 0px)'}); } } }); var mainSwiper = new Swiper('.main_visual', { allowTouchMove:false, pagination: { el: '.visual_pagination', clickable: true, }, loop:true, autoplay: { delay: 4500, disableOnInteraction: false, }, effect: 'fade', }); var pipelineSwiper = new Swiper('.pipeline_slide', { slidesPerView: 'auto', allowTouchMove:false, breakpoints: { 970: { allowTouchMove:true, }, }, }); var newsSwiper = new Swiper('.news_list', { slidesPerView: 'auto', pagination: { el: '.news_pagination', }, navigation: { nextEl: ".news_next", prevEl: ".news_prev", }, }); //scroll_btn $('.scroll_btn').on('click', function(){ if($(".scroll_btn").hasClass("down")){ fullSlide.slideTo(1, 500); }else if($(".scroll_btn").hasClass("top")){ fullSlide.slideTo(0, 500); } }); });