From f033cb0d94c73e3272ec60c71d429b330570f9cf Mon Sep 17 00:00:00 2001 From: nael Date: Tue, 2 Jul 2019 18:22:56 +0200 Subject: [PATCH] wip #2747 --- public/_modules/home-slider/index.html | 1 - public/_modules/home-slider/slider.js | 31 ++++++++++++++++---------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/public/_modules/home-slider/index.html b/public/_modules/home-slider/index.html index 1e69e92..a197594 100644 --- a/public/_modules/home-slider/index.html +++ b/public/_modules/home-slider/index.html @@ -145,7 +145,6 @@ - diff --git a/public/_modules/home-slider/slider.js b/public/_modules/home-slider/slider.js index 9fe4363..04e135a 100644 --- a/public/_modules/home-slider/slider.js +++ b/public/_modules/home-slider/slider.js @@ -10,18 +10,25 @@ let animationDuration = 0; let delayBetweenAnim = 0; let mouvement = 0; - prevBtn.click(function() { - nextBtn.prop("disabled", false); - - if (index > 0) { - index--; - $(".column-wrapper").removeClass("active").eq(index).addClass("active"); - }; - - if (index === 0) { - $(this).prop("disabled", true); - } - }); +prevBtn.click(function() { + nextBtn.prop("disabled", false); + + if (index > 0) { + index--; + // $(".column-wrapper").removeClass("active").eq(index).addClass("active"); + $(".slide").removeClass("active").eq(index).queue(function(next){ + $(this).addClass("active"); + // TweenMax.from($(this),1,{ y: -10}); + let tl = new TimelineMax(); + tl.from($('.slide-txt'),1,{ x: -50}); + next(); + }); + }; + + if (index === 0) { + $(this).prop("disabled", true); + } +}); nextBtn.click(function() { setTimeout(function () { -- 2.39.5