Forum Discussion
Carousel
Hi Keith,
There were several issues with this interaction, including incorrect initial positioning of the cards, cards rotating out of sequence, and visual glitches caused by overlapping transitions. I’ve fixed the positioning so that Card 1 now correctly starts at the front, and the card order logic is aligned with the button inputs.
However, the biggest issue was due to users clicking the buttons too quickly. Each button triggers a GSAP rotation function, and if another button is clicked before the previous animation finishes, the rotation logic breaks often resulting in the wrong card coming forward.
To address this, I’ve added a "locking mechanism" using a variable (isAnimating) that tracks when an animation is in progress. This prevents new rotation calls from being triggered until the current animation is complete. I’ve also linked this variable to Storyline, allowing the buttons to be temporarily disabled while the rotation is active avoiding accidental or rapid clicks.
I've attached a revised version of your Story file for review.
Hi Nedim,
How are you?
Thank you for helping out. That's really appreciated.
However, I don't think that this is working as I have envisioned.
It starts off with the right card when I preview but the buttons do not work as you stated because of the triggers that disable these. Therefore the cards do not rotate around when you click them.
Thanks
Related Content
- 5 months ago
- 11 months ago