From: vincent@cubedesigners.com Date: Tue, 13 Aug 2013 13:28:49 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b6ffaa10c04ae897a3bf2c94a23fe343add89ab4;p=ccgm.git --- diff --git a/css/actualites.css b/css/actualites.css index 62795ab..4dd919b 100644 --- a/css/actualites.css +++ b/css/actualites.css @@ -38,13 +38,15 @@ height: 31px; text-indent: -9999px; overflow: hidden; - bottom: 68px; - float:left; + top:0px; + right:35px; + position:absolute; background-image: url(../images/arrow-news-left.svg); background-size: 30px 30px; } .updates .btn-next { margin:0 0 0 5px; + right:0px; background-image: url(../images/arrow-news-right.svg); } .updates .btn-area{ diff --git a/js/actualites.js b/js/actualites.js index 7ed9c71..bd9f362 100644 --- a/js/actualites.js +++ b/js/actualites.js @@ -39,6 +39,8 @@ } var $this = this; this.animating = true; + var w = 870; + var d = 0.5; var dir = -1; if (index > this.currentIndex) { dir = 1; @@ -49,18 +51,39 @@ if (this.currentIndex == -1) { $(nextActu).show(); + this.arrowsVisibility(index, d); this.endTransition(index); return; } var currentActu = this.getActu(this.currentIndex); - var w = 870; + $(nextActu).css('left', w * -dir).show(); - TweenMax.to(nextActu, 0.5, {left: 0}); - TweenMax.to(currentActu, 0.5, {left: w * dir, onComplete: function() { + TweenMax.to(nextActu, d, {left: 0}); + TweenMax.to(currentActu, d, {left: w * dir, onComplete: function() { $this.endTransition(index); } }); + this.arrowsVisibility(index, d); + + + + + }, + arrowsVisibility: function(index, d) { + var prev = this.element.find('.btn-prev'); + var next = this.element.find('.btn-next'); + if (index == 0) { + $(prev).fadeOut(d * 1000); + } else { + $(prev).fadeIn(d * 1000); + } + + if (index == this.number - 1) { + $(next).fadeOut(d * 1000); + } else { + $(next).fadeIn(d * 1000); + } }, getActu: function(index) { return this.element.find('.slide:eq(' + index + ')'); @@ -69,11 +92,6 @@ this.animating = false; this.getActu(this.currentIndex).hide(); this.currentIndex = index; - if (this.currentIndex == 0) { - TweenMax.to(this.element.find('.btn-prev'), 0.5, {opacity: 0}); - } else { - - } }, };