cagkebabi Posted October 14, 2024 Posted October 14, 2024 Hello, what I want to do is to perform a scrollto operation according to a certain condition when the page is loaded, but I can only run the scrollto plugin when I add a click event listener to an element, for example. I have stated the part where I am having trouble with the codepen example with a comment line, thank you in advance for your help. See the Pen OJKpbLx by CagKebabi (@CagKebabi) on CodePen.
mvaneijgen Posted October 14, 2024 Posted October 14, 2024 If I just use scrollTo everything works as expect! Probably your scroll plugin is trowing a wrench in the mix and that is beyond the scope on this forum. Highly encourage you to use our own scroll smoother plugin aptly named ScrollSmoother https://gsap.com/docs/v3/Plugins/ScrollSmoother/ which works out of the box with all the GSAP tools! Hope it helps and happy tweening! See the Pen mdNWOxX?editors=0010 by mvaneijgen (@mvaneijgen) on CodePen.
Solution Rodrigo Posted October 14, 2024 Solution Posted October 14, 2024 Hi, You're using Locomotive's scrollTo method, that is a part of Locomotive's API, not our API so for obvious reasons we can't really offer support it. We have the ScrollTo Plugin as well as the ScrollSmoother Plugin (which also has a ScrollTo method as well): https://gsap.com/docs/v3/Plugins/ScrollSmoother/ https://gsap.com/docs/v3/Plugins/ScrollToPlugin Hopefully this helps Happy Tweening!
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