$(function(){ $(window).resize(function(){ ww = $(window).width(); if(ww < 1400){ $("body").addClass("mobile"); }else{ $("body").removeClass("mobile"); } }).resize(); //fullpage $('#fullpage').fullpage({ navigation: true, slidesToSections: true, scrollingSpeed: 770, // ** afterLoad : function(anchorLink, index){ //active class $('.sec'+index).addClass('ani'); //top button switch(index) { case 1: //$('.scroll_top_btn').fadeOut(300); break; case 2: //$('.scroll_top_btn').fadeIn(500).addClass("hide"); break; case 9: $('.scroll').css("bottom","220px"); break; default: $('.scroll').css("bottom","60px"); break; } //business if(index == 3){ }else{ $.fn.fullpage.setAllowScrolling(true); } if(index == 2 || index == 3 || index == 5){ $("body").addClass("bl"); }else{ $("body").removeClass("bl"); } }, // ** onLeave : function(anchorLink, destination, direction, index){ }, }); /* visual */ var swiper1 = new Swiper('.visual', { effect: 'fade', slidesPerView: 1, speed: 1600, loop: true, touchRatio: 0, navigation: { nextEl: '.vnext', prevEl: '.vprev', }, pagination: { el: '.vpaging', clickable: true, }, //autoplay: { // delay: 5000, //}, }); swiper1.on('slideChange', function() { $(".ctr .this").html((swiper1.realIndex)+1); }); setPageNum = function(){ totalNum = $(".visual .swiper-slide").length - 2; $(".ctr .total").html(totalNum); } setPageNum(); //business_bg img var swiper2 = new Swiper('.main_sec3', { direction: "vertical", effect: "slide", loop:false, speed: 1200, autoplay: false, allowTouchMove:false, simulateTouch:false, grabCursor: false, parallax: true, mousewheel: { releaseOnEdges: true }, mousewheel: true, watchSlidesVisibility: true, watchSlidesProgress: true, on: { slideChangeTransitionEnd: function () { $(".item").removeClass("off"); if(this.realIndex == 0){ $(".item1").addClass("off"); }else if(this.realIndex == 3){ $(".item4").addClass("off"); }else{ $(".item").removeClass("off"); } }, slideChange: function () { $(".sec3_wrap .main_sec3 .con ul li").removeClass(); $(".sec3_wrap .main_sec3 .con ul li:eq("+this.realIndex+")").addClass("on"); $(".sec3_wrap .main_sec3 .con ul").removeClass(); $(".sec3_wrap .main_sec3 .con ul").addClass("list"+this.realIndex+""); }, }, }); //// sec3 mousewheel $(".fix").on("DOMMouseScroll mousewheel wheel", function(event,delta){ if (delta > 0) { //마우스 휠을 올렸을때 if($(".sec3 .item1").hasClass("off")){ $.fn.fullpage.moveTo(2); } if($(".sec3 .item4").hasClass("off")){ $.fn.fullpage.setAllowScrolling(false); } }else if (delta < 0) { //마우스 휠을 내렸을때 if($(".sec3 .item4").hasClass("off")){ $.fn.fullpage.moveTo(4); }else{ $.fn.fullpage.setAllowScrolling(false); } } }); $(".sec3_wrap .main_sec3 .con ul li").click(function(){ liNum = $(".sec3_wrap .main_sec3 .con ul li").index($(this)); swiper2.slideTo(liNum, 1000, false) }) });