Jump to content
Search Community

Adding delay between two scrools

SimonSays test
Moderator Tag

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 comment
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 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...