SimonSays Posted January 29, 2021 Share Posted January 29, 2021 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 More sharing options...
SimonSays Posted January 29, 2021 Author Share Posted January 29, 2021 question 2. How to kill this scroll if not finished and clicked again? Link to comment Share on other sites More sharing options...
GreenSock Posted January 29, 2021 Share Posted January 29, 2021 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? 5 Link to comment Share on other sites More sharing options...
GreenSock Posted January 29, 2021 Share Posted January 29, 2021 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 4 Link to comment Share on other sites More sharing options...
SimonSays Posted January 30, 2021 Author Share Posted January 30, 2021 can i somehow pause and unpause it aftewards? Link to comment Share on other sites More sharing options...
ZachSaucier Posted January 30, 2021 Share Posted January 30, 2021 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 comment Share on other sites More sharing options...
SimonSays Posted January 30, 2021 Author Share Posted January 30, 2021 nothing i already used pause and resume : ) 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