$(function(){ $("body").addClass("intro"); // 레이어팝업 var bg = $("#bg"); $(document).on('click',' #bg, .close ', function () { bg.fadeOut(); $('#video-popup div.inner').html(''); $('#video-popup').hide(); }); $('.play_btn').on('click', function(){ var dataUrl = $(this).attr('data-url'); if(dataUrl){ bg.show(); $('#video-popup').show(); $('#video-popup').html( ''+ '
'+ '
' ); $('#video-popup div.inner').html(dataUrl); }else { alert('준비중 입니다.'); } }); var fullSwiper = new Swiper('.full_slider', { slidesPerView:'auto', direction: "vertical", effect: "slide", autoplay: false, speed: 800, //parallax: true, pagination: { el: ".full_pagination", clickable: true, }, allowTouchMove:true, simulateTouch:false, grabCursor: false, /**touchStartPreventDefault:true,**/ touchStartPreventDefault:false, watchSlidesProgress: true, watchSlidesVisibility: true, mousewheel: { releaseOnEdges: true }, observer: true, // 추가 observeParents: true, // 추가 mousewheelControl: true, on: { init: function(){ let idx = this.activeIndex; let slideDownIdx = this.activeIndex + 1; if(idx <= 5 ){ $(".scroll_btn").click(function(){ fullSwiper.slideTo(slideDownIdx,300); }); }else { $(".scroll_btn").click(function(){ fullSwiper.slideTo(0,300); }); } if($(".section:eq("+idx+")").hasClass("swiper-slide-active")){ $(".section:eq("+idx+")").addClass("on"); } if(idx == 1){ }else{ } }, transitionStart: function(){ let idx = this.activeIndex; let slideDownIdx = this.activeIndex + 1; console.log(idx) if(idx <= 4 ){ $(".scroll_btn").click(function(){ fullSwiper.slideTo(slideDownIdx,300); }); $(".scroll_btn .scroll").show(); $(".scroll_btn .top").hide(); }else { $(".scroll_btn").click(function(){ fullSwiper.slideTo(0,300); }); $(".scroll_btn .top").show(); $(".scroll_btn .scroll").hide(); } /* if(idx == 0 ){ $("header").removeClass("on"); }else { $("header").addClass("on"); } */ if(idx == 1 ){ $(".scroll_btn").addClass("wht"); }else { $(".scroll_btn").removeClass("wht"); } if(idx == 2 ){ portfolioSwiper.autoplay.start(); }else { portfolioSwiper.autoplay.stop(); } if($(".section:eq("+idx+")").hasClass("swiper-slide-active")){ $(".section:eq("+idx+")").addClass("on"); } if($(".section:eq("+idx+")").hasClass("bk")){ $("body").addClass("bk"); }else { $("body").removeClass("bk"); } let footerHgt = $("#footer").height(); if($(".footer_section").hasClass("swiper-slide-visible")){ $(".full_slider .scroll_btn").css("bottom",29 + footerHgt); }else { $(".full_slider .scroll_btn").css("bottom",29 ); } }, }, }); //section2 - buisness list hover js $(".section2 .business_list li").mouseover(function(){ let idx = $(this).index(); $(".section2 .business_img_list li").removeClass("on"); $(".section2 .business_img_list li:eq("+idx+")").addClass("on"); }); var portfolioSwiper = new Swiper(".portfolio_slider", { speed: 800, slidesPerView:'auto', centeredSlides: true, loop:true, //autoplay: { //delay: 4000, //disableOnInteraction: false, //}, navigation: { nextEl: ".portfolio_next", prevEl: ".portfolio_prev", }, allowTouchMove:false, breakpoints: { }, on: { slideChange: function () { $(".section3 .portfolio_slider .bg li:eq("+this.realIndex+")").addClass("on").siblings().removeClass("on"); } } }); var newsSwiper = new Swiper(".news_slider", { speed: 600, slidesPerView:'auto', //loop:true, /*autoplay: { delay: 3000, disableOnInteraction: false, },*/ navigation: { nextEl: ".news_next", prevEl: ".news_prev", }, }); /* 태블릿/모바일버전 일때 비지니스 영역 호버효과 해제 */ $(window).resize(function(){ ww = $(window).width(); if(ww > 1280){ $(".section2 .conwrap .business_list_wrap .business_list li").addClass("custom_hover"); }else{ $(".section2 .conwrap .business_list_wrap .business_list li").removeClass("custom_hover"); } }).resize(); });