I have a Swiper slider and a counter position like "1/10". I would like to change that current slide number (the 1) with an animation. I know how to replace the number but with this animation, it's like another story:
As you can see on the gif, it's working nicely if I click moderately on my slider, but when I double-triple-or-crazy click on the next link, that totally breaks the counter, due to the clone made in this gif example.
Do you know how can I do that in a better way?
I made a jsfiddle, working for the first count change only:
— http://jsfiddle.net/asb39sff/1/
// Init
var $c_cur = $("#count_cur"),
$c_next = $("#count_next");
TweenLite.set($c_next, {y: 12, opacity: 0}, "count");
// Change counter function
function photos_change(swiper) {
var index = swiper.activeIndex +1,
$current = $(".photo-slide").eq(index),
dur = 0.8,
tl = new TimelineLite();
// Just a test
tl.to($c_cur, dur, {y: -12, opacity: 0}, "count")
.to($c_next, dur, {y: 0, opacity: 1}, "count")
//$c_cur.text(index);
//$c_next.text(index + 1);
}