Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
SimonSays

Adding delay between two scrools

Recommended Posts

gsap.to(window, {duration: 0, scrollTo: from})
gsap.delay(time).to(window, {duration: speed, scrollTo: to})

gsap.to(window, {duration: 0, scrollTo: from}).delay(time).to(window, {duration: speed, scrollTo: to})

I was trying these two ways, but nothign works, anyone have any idea how can i do that in the correct way?

Link to post
Share on other sites

question 2. How to kill this scroll if not finished and clicked again?

Link to post
Share on other sites

There are many ways...

 

Just use a regular delay (it's a special property):

gsap.to(window, {duration: 0, scrollTo: from})
gsap.to(window, {delay: time, duration: speed, scrollTo: to})

Or use a timeline:

let tl = gsap.timeline();
tl.to(window, {duration: 0, scrollTo: from});
  .to(window, {duration: speed, scrollTo: to}, time);

There are other ways too. 

 

Does that help? 

  • Like 5
Link to post
Share on other sites
1 minute ago, SimonSays said:

question 2. How to kill this scroll if not finished and clicked again?

You can kill() any tween anytime. Or you can use gsap.killTweensOf(). 

 

tl.kill(); // kill the timeline

gsap.killTweensOf(window); // kill all tweens of the window immediately

 

  • Like 4
Link to post
Share on other sites

can i somehow pause and unpause it aftewards?

Link to post
Share on other sites
27 minutes ago, SimonSays said:

can i somehow pause and unpause it aftewards?

What do you mean by this? A minimal demo would make things more clear.

Link to post
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.

×