Thank you Jonathan, but I didnt want to re-write all the carousel for this.
Actually, I found the way out in the documentation - the condition that checks if the object is tweeneing at the moment.
if (!TweenMax.isTweening(your_array)) {}
So carousel works and it looks like this. Maybe someone else will find it helpful.
gwd.auto_Next_Arrow_tapareaAction = function(event) {var product_slides = document.getElementById("product_slides");
if (current_product < product_images_array.length - 1) {
if (!TweenMax.isTweening(product_slides)) {
current_product++;
console.log("Free to move, curent product: " + current_product);
TweenLite.to(product_slides, .5, {
left: "-=300px",
ease: Quad.easeOut
});
} else {
console.log("Stoped the move");
}
} else {
if (!TweenMax.isTweening(product_slides)) {
TweenLite.to(product_slides, 0.5, {
left: "0px",
delay: 0.5,
ease: Quad.easeOut
});
current_product = 0;
console.log("Free to move, curent product: " + current_product);
} else {
console.log("Stoped the move");
}
}
};