}\r
var $this = this;\r
this.animating = true;\r
+ var w = 870;\r
+ var d = 0.5;\r
var dir = -1;\r
if (index > this.currentIndex) {\r
dir = 1;\r
\r
if (this.currentIndex == -1) {\r
$(nextActu).show();\r
+ this.arrowsVisibility(index, d);\r
this.endTransition(index);\r
return;\r
}\r
var currentActu = this.getActu(this.currentIndex);\r
- var w = 870;\r
+\r
\r
$(nextActu).css('left', w * -dir).show();\r
- TweenMax.to(nextActu, 0.5, {left: 0});\r
- TweenMax.to(currentActu, 0.5, {left: w * dir, onComplete: function() {\r
+ TweenMax.to(nextActu, d, {left: 0});\r
+ TweenMax.to(currentActu, d, {left: w * dir, onComplete: function() {\r
$this.endTransition(index);\r
}\r
});\r
+ this.arrowsVisibility(index, d);\r
+\r
+\r
+\r
+\r
+ },\r
+ arrowsVisibility: function(index, d) {\r
+ var prev = this.element.find('.btn-prev');\r
+ var next = this.element.find('.btn-next');\r
+ if (index == 0) {\r
+ $(prev).fadeOut(d * 1000);\r
+ } else {\r
+ $(prev).fadeIn(d * 1000);\r
+ }\r
+\r
+ if (index == this.number - 1) {\r
+ $(next).fadeOut(d * 1000);\r
+ } else {\r
+ $(next).fadeIn(d * 1000);\r
+ }\r
},\r
getActu: function(index) {\r
return this.element.find('.slide:eq(' + index + ')');\r
this.animating = false;\r
this.getActu(this.currentIndex).hide();\r
this.currentIndex = index;\r
- if (this.currentIndex == 0) {\r
- TweenMax.to(this.element.find('.btn-prev'), 0.5, {opacity: 0});\r
- } else {\r
-\r
- }\r
},\r
};\r
\r