Hi folks!
Been using ScrollTrigger since last week, and amazed at the power and flexibility it yields! Working with it super fun! ?
I've run into a particular issue while trying to implement a conditional show/hide of two objects within the same timeline. As demo'ed in the CodePen, I have two bars that grows together while scrolling, with button toggles to show/hide only one of them at a time. Ideally, when I toggle, I want to restart the timeline so that the visible bar animates to the height per the current scroll position. I've tried to use the Timeline Restart function, which even though does restart the animation correctly, seems to go ahead and kill the ScrollTrigger (or rather override it partially); it does not listen to the scroll position anymore and just goes ahead and completes the animation on its own. I tried including ScrollTrigger.refresh() but that doesn't change anything either. Is there a workaround to this, or am I doing something wrong?
Thanks in advance!