Jump to content
Search Community

How to pause timeline that has scrollTrigger

Codetipi test
Moderator Tag

Recommended Posts

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

  

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

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();

 

  • Like 2
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...