Yes I forgot that function, thank you !
I tested to nest a tween inside the "onComplete", I don't know if it's nice, but that work :
gsap.to(".active", {
backgroundColor: '#eeeeee',
color: "#000000",
scale: .3,
onComplete: () => {
$(".active").removeClass("active");
$(toActive).addClass("active");
gsap.to(toActive, {
backgroundColor: '#008000',
color: '#fff',
scale: 1,
stagger: .1
});
}
});
Exemple :
https://codepen.io/Jean-Loic/pen/povyNeR
It have some problems when I click rapidly on each button.
Is it because I click before the "onComplete" finish ?