Codetipi Posted July 15, 2020 Share Posted July 15, 2020 Hey guys, Is there a way to pause (or remove) a timeline with ScrollTrigger? In the pen attached I added a timeout just to test it out, but it doesn't pause it. Thanks! See the Pen RwrYJMr by forthetipi (@forthetipi) on CodePen Link to comment Share on other sites More sharing options...
ZachSaucier Posted July 15, 2020 Share Posted July 15, 2020 Hey Codetipi. What are you hoping the pause (or remove) to do? In what context are you wanting it to pause or be removed? Have you seen the .disable() method? Link to comment Share on other sites More sharing options...
Codetipi Posted July 15, 2020 Author Share Posted July 15, 2020 I'm looking to freeze the "y: movement," changes of the layers. As a quick example, imagine adding a "disable parallax" button on that page for visitors to click if they wanted to disable the header parallax effects from running. Edit: adding the disable() to the pen, but it doesn't seem to work. Link to comment Share on other sites More sharing options...
ZachSaucier Posted July 15, 2020 Share Posted July 15, 2020 3 minutes ago, Codetipi said: imagine adding a "disable parallax" button on that page for visitors to click if they wanted to disable the header parallax effects from running. Wouldn't it be better for that button to just kill off the parallax ScrollTriggers? Link to comment Share on other sites More sharing options...
Codetipi Posted July 15, 2020 Author Share Posted July 15, 2020 Just now, ZachSaucier said: Wouldn't it be better for that button to just kill off the parallax ScrollTriggers? Yeah that would work too, but I tried using the .kill() method on the tl var, and it doesn't seem to do anything. I must be using it wrong - but I saved the pen with it applied. Link to comment Share on other sites More sharing options...
ZachSaucier Posted July 15, 2020 Share Posted July 15, 2020 2 minutes ago, Codetipi said: I tried using the .kill() method on the tl var, and it doesn't seem to do anything. I must be using it wrong - but I saved the pen with it applied. You should kill both the ScrollTrigger and the timeline: tl.scrollTrigger.kill(); tl.kill(); or just the ScrollTrigger (depending on your needs): tl.scrollTrigger.kill(); 2 Link to comment Share on other sites More sharing options...
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