Franco95 Posted November 28, 2023 Share Posted November 28, 2023 Hi there! I'm facing an issue with my scrollTrigger functionality. I have my website with 5 sections and I'm using gsap to jump to the next section and overlap it with the scroll, my problem is that now I need to add redirections in my navbar to each of those sections but the result is not good, I have to repeat my "goToSection" function multiple times to reach the section "3" for example. So I want to achieve with one click and one function execution, scrolling to the desired section with no problem I don't have a minimal demo because my website it is very advanced, but I have a codepen that I used as a guide. I will appreciate any help from you guys! Thank you very much. See the Pen XWXdypQ by urbgimtam (@urbgimtam) on CodePen Link to comment Share on other sites More sharing options...
Rodrigo Posted November 28, 2023 Share Posted November 28, 2023 Hi, There are no links and/or navbar in the demo you posted, which is working as expected. Please update your demo so it replicates the issue you're having and post another message in this thread (editing your original post won't send us a notification) 🙏 Happy Tweening! Link to comment Share on other sites More sharing options...
Franco95 Posted November 29, 2023 Author Share Posted November 29, 2023 On 11/28/2023 at 6:43 PM, Rodrigo said: Hi, There are no links and/or navbar in the demo you posted, which is working as expected. Please update your demo so it replicates the issue you're having and post another message in this thread (editing your original post won't send us a notification) 🙏 Happy Tweening! Hi @Rodrigo! I have made the changes, as you can see if you are in section 2 and click in navbar (section 4), it goes first to section 3. My conclusion is that it only scroll by one section, but I really need that if I click in navbar goes to the section I clicked. See the Pen gOqdooO by francobuceta (@francobuceta) on CodePen Link to comment Share on other sites More sharing options...
GSAP Helper Posted December 1, 2023 Share Posted December 1, 2023 Duplicate post. We see you didn't get an answer yet, but please keep the topic contained to one thread. Link to comment Share on other sites More sharing options...
Solution GreenSock Posted December 1, 2023 Solution Share Posted December 1, 2023 You mean like this?: See the Pen LYqgqwp?editors=1010 by GreenSock (@GreenSock) on CodePen 1 Link to comment Share on other sites More sharing options...
Franco95 Posted December 2, 2023 Author Share Posted December 2, 2023 On 12/1/2023 at 3:14 PM, GreenSock said: You mean like this?: Yes!! Thank you very much! I have been struggling for days with this. This is the solution 😄 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