dvdslns Posted June 7, 2021 Share Posted June 7, 2021 Hi all! I'm having some issues trying to recreate a functionality similar to fullPage.js. Based on this post and the pens posted I could replicate a "snap to section" effect on scroll, but my issue is when I try to navigate to different sections using scrollTo. My issue is that navigation anchors only skip to adjacent sections. I think it's because the onEnter and onEnterBack callbacks. How could I "override" this actions and make the scrollTo anchors jump to the right section? Thanks in advance! See the Pen wvJXegB by omaidog (@omaidog) on CodePen Link to comment Share on other sites More sharing options...
elegantseagulls Posted June 7, 2021 Share Posted June 7, 2021 You could probably set a variable to determine if the nav has been clicked/is actively animating and make your goToSection() tween conditional based on that. 3 Link to comment Share on other sites More sharing options...
Solution akapowl Posted June 8, 2021 Solution Share Posted June 8, 2021 16 hours ago, elegantseagulls said: You could probably set a variable to determine if the nav has been clicked/is actively animating and make your goToSection() tween conditional based on that. This thread shows an example of that - maybe it helps: 3 Link to comment Share on other sites More sharing options...
GreenSock Posted June 8, 2021 Share Posted June 8, 2021 Side note: be very careful about applying CSS transitions to things that GSAP controls. They can cause a lot of problems. 2 Link to comment Share on other sites More sharing options...
dvdslns Posted June 8, 2021 Author Share Posted June 8, 2021 10 hours ago, akapowl said: This thread shows an example of that - maybe it helps: Thank you @elegantseagulls @akapowl, IT WORKS! I've updated the pen using @akapowl's example as reference.@GreenSock note taken! I can imagine that it can cause weird issues. The transitions were there to spice up a little the pen example but I figure that GSAP is the best tool for that too ❤️ 1 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