I am wanting to set which image animates based on a button click. So if I click the first button "E18MCL" then the dinosaur would animate. Then if I scroll back up and click the other button "E18MML" then the giraffe would animate. I am using JS to set a class (marquee__modals--active) on the image I want to animate on button click. This is working correctly, the class is added when needed. My issue is that my fromTo tween seems to grab the element on page load then never reloads it. So on page load the dinosaur has that class, so every button click makes him animate, even if the giraffe has the class later.
My current code is attempting to be a bit dynamic, but I tried hardcoding the classes and just making two click event listeners. This worked for the first click, but then with the second click both images animated. I'm guessing I need to kill something but I'm not sure where to do that.
Thank you!