It looks like all the dom elements get bound within the timeline on load, which makes sense, but I'm wondering if it's possible to update that when you scroll back into the timeline?
Meaning like, if I have something like this let element = document.querySelector('.first-element');
and then within a timeline I do an animation to it
t1.fromTo(element, {
opacity: 0
}, {
opacity: 1
});
then because of other stuff that happens on the page, I need that to target a different element onEnterBack so I add this
onEnterBack: () => resetTarget()
const resetTarget = () => {
element = document.querySelector('.new-target');
}
The timeline still targets to first element when reversing the animation. Is there a way to update that element or would I essentially have to create two separate timelines that trigger based on scroll direction?