$(function(){ var mainSwiper = new Swiper('.visual', { //effect:'fade', speed: 1500, loop: true, autoHeight : true, /*autoplay: { delay: 5000, disableOnInteraction: true, },*/ pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.vnext', prevEl: '.vprev', }, on: { slideChange: function () { if(this.realIndex == 1 || this.realIndex == 2){ $("#header").addClass("wh"); }else{ $("#header").removeClass("wh"); } } } }); var swiper1 = new Swiper('.case', { slidesPerView: "auto", spaceBetween: 15, //loop:true, speed:1500, on: { slideChange: function () { } } }); $circle = $(".section2 .case").find(".drag"); $("body").on('mousemove draggable mousedown', function(e){ TweenLite.to($circle, 0.6, { css: { x: e.clientX , y: e.clientY }, ease: Power3.easeOut }); }); $(document).on('mouseover',".section2 .case", function(){ $circle.show(); $circle.find(".circle").addClass("on"); }); $(document).on('mouseleave',".section2 .case", function(){ //$circle.hide(); $circle.find(".circle").removeClass("on"); }); var swiper2 = new Swiper('.sec3', { slidesPerView: "1", spaceBetween: 0, loop:true, autoplay:true, navigation: { nextEl: '.sec3_next', prevEl: '.sec3_prev', }, speed:1500, on: { slideChange: function () { $(".section3 .tabarea ul li:eq("+this.realIndex+")").addClass("on").siblings().removeClass("on"); } } }); $(".section3 .tabarea ul li").click(function(){ liNum = $(".section3 .tabarea ul li").index($(this)) + 1; $(this).addClass("on").siblings().removeClass("on"); swiper2.slideTo(liNum) }); /* */ $(".scroll").click(function(){ wh = $(window).height(); hh = $("#header").outerHeight(); $('body,html').animate({scrollTop: wh - hh}, 400); }) });