AnthonyK Posted July 18, 2023 Share Posted July 18, 2023 I am using the code from the "Variable height stacked pinning - ScrollTrigger" demo I have multiple <sections> with the class of "panel" but on load, the page is auto-scrolling to the first panel with the class of "panel". I need to see the main navigation and first hero banner on page load. I only want the scroll effect to happen when you scroll to those sections. See here: https://thecommsgurus.com.au/testimonials-2/ (Not a Javascript buff - sorry!). What am I doing wrong? Apologies for the beginner question. See the Pen KKpLdWW by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
mvaneijgen Posted July 18, 2023 Share Posted July 18, 2023 Hi @AnthonyK welcome to the forum What have you tried already? We love to see minimal demo's, that way we can see your thought process and thus better help you. Sorry we can't really debug live websites, there is just no way to modify the code. Try creating a minimal demo of what you're trying to do, this has two benefits. First this allows you to experiment and try out new ideas. By making it simple people usually solve 90% of their own bugs. Second, you have an easy version you can share in which anyone could edit and modify the code. 2 Link to comment Share on other sites More sharing options...
AnthonyK Posted July 18, 2023 Author Share Posted July 18, 2023 Thanks @mvaneijgen See the Pen eYQrzBP by Anthony-Keal (@Anthony-Keal) on CodePen See how the first div is autoscrolled past. Link to comment Share on other sites More sharing options...
mvaneijgen Posted July 18, 2023 Share Posted July 18, 2023 That is because the snap is invoked as soon as the page loads, eg the start markers already touch. I've changed the start marker too be -20px from he bottom. Enabling markers is really help full when debugging ScrollTriggers, so also do that in your project and see where you expect the markers to be and check if that is correct. See the Pen GRwdjKM?editors=0010 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