Hi,
I'm trying to declare a simple tween with a scrollTrigger attached to it (like the one below for instance), but I want to control the moment this tween and its scrolltrigger are fired.
let tween = gsap.from('.text', {
opacity: 0,
duration: 2,
scrollTrigger: {
trigger: '.text',
}
});
In other words, I just want to declare it, I don't want to play it right away!
Then, I want to be able to manually activate the scrollTrigger later on, and play the tween accordingly (if the element is in the viewport, the tween should play, else it should wait).
I've tried different combination of tween.scrollTrigger.disable(), tween.pause(), and also tried using the ScrollTrigger.create() approach but nothing seems to work!
Is that even possible? ?
Many thanks! ?