krisxtina Posted July 24, 2022 Posted July 24, 2022 Hello! I can`t disable scrub in single timeline. let tl2 = gsap.timeline({ scrollTrigger: { trigger: "#content", scrub: 2, pin: "#content", pinSpacing: false, start: self => self.previous().end, end: "+=2000 }, defaults: { ease: "none" } }); tl2.to(".content__inner", { opacity: 1 }, 0) tl2.to(charsRow1, { scrollTrigger: { trigger: '#content', scrub: false }, y: 0, opacity: 1, stagger: 0.04, }, 0) First timeline works with scrub, but I want disable it in second one. How I can do it?
Dipscom Posted July 24, 2022 Posted July 24, 2022 Hey Krisxtina, If I understand correctly what you are trying to achieve, you need to have the ScrollTriggers associated with the sections you want them to control, not the whole timeline. Alternatively, you might want to use completely different timelines and have the ScrollTriggers associated with each one. What you can't have is dynamic enable and disable of the scrubbing on a ScrollTrigger as far as I know.
GreenSock Posted July 25, 2022 Posted July 25, 2022 Yeah, you definitely shouldn't have a ScrollTrigger nested inside a tween that's inside a timeline like that. It's logically impossible for the playhead to be controlled BOTH by the parent timeline AND the scrollbar's position. It's totally fine to have a ScrollTrigger on the timeline itself - just not nested inside a sub-tween of that timeline. I'm pretty confused about what you're trying to do here - could you please post a very minimal demo?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now