// $(document).mousemove(function(e){ // var pos = $(".txt").width()/2; // $(".txt1 span").css({"transform":"translateX(" + Math.round((e.pageX - pos)/5) + "px)"}); // $(".txt2 span").css({"transform":"translateX(" + Math.round((pos-e.pageX)/3) + "px)"}); // }); $(window).scroll(function(e){ //since_motion(); /* 모션있을때 백업 */ }); var since_motion = function(){ var txtY = $(".txt_since").offset().top-$(window).height(); var motionX = ($(window).scrollTop()-txtY)/20; if(txtY < $(window).scrollTop() && txtY+$(window).height() > $(window).scrollTop()) { $(".txt1 span").css({"transform":"translateX(" + -motionX + "px)"}); $(".txt2 span").css({"transform":"translateX(" + motionX + "px)"}); } if(txtY < $(window).scrollTop()/1.2 && txtY+$(window).height() > $(window).scrollTop()) { $(".txt_since").addClass("on"); } else { $(".txt_since").removeClass("on"); } } $(function(){ var swiper = new Swiper('#swiper1', { slidesPerView: "auto", mousewheel: true, pagination: { el: '.swiper-pagination', clickable: true, }, on: { slideChangeTransitionEnd: function(){ $(".business_nav .menu li a").removeClass("on"); $(".business_nav .menu li").eq(this.activeIndex).find("a").addClass("on"); } }, breakpoints: { 320: { slidesPerView: 1 }, 1200: { slidesPerView: 2 } }, }); $(".business_nav .menu li a").on("click", function(){ var idx = $(this).parent().index(); swiper.slideTo(idx); }); });