Jump to content
Search Community

Disable scrub in single timeline

krisxtina test
Moderator Tag

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...