Ali961 Posted August 1, 2022 Share Posted August 1, 2022 please have a look at the code . as u see the gsap code starts working from a specific location while the function starts one the page is loaded . how can I let the function starts at the same time of the gsap code ? thank you See the Pen LYdQVzg by ali961 (@ali961) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted August 2, 2022 Share Posted August 2, 2022 I read your question a few times and I still don't understand what you're asking, sorry. GSAP tweens have callbacks like onStart, onComplete, onUpdate, etc. Or if you're trying to fire a function when the scroll position gets to a certain spot, you can use ScrollTrigger.create() and just set the start to whatever you want, and use an onEnter to call your function. If you still need help, please make sure your minimal demo isolates the issue as much as possible and maybe rephrase your question so we can better understand. Link to comment Share on other sites More sharing options...
Ali961 Posted August 2, 2022 Author Share Posted August 2, 2022 yes i want the function to start at the same position that the GSAP does . The function starts once the page is loaded while the GSAP one starts when the scroll reached a specific spot . Link to comment Share on other sites More sharing options...
mvaneijgen Posted August 2, 2022 Share Posted August 2, 2022 Do you want to animate the numbers based on scroll? Here is an example that does that, but with way less complicated code. See the Pen poLawEa by mvaneijgen (@mvaneijgen) on CodePen 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