c0c0t3 Posted July 20 Share Posted July 20 Hello, I'm pretty new with gsap. When I scrollsmoother is activated, it's like the "viewport" is being reduced when I scroll down. Behavior expected : See the Pen VwVdBBw by amazingweb (@amazingweb) on CodePen The code only works in desktop for now (>991px) See the Pen ExOREMJ by amazingweb (@amazingweb) on CodePen Link to comment Share on other sites More sharing options...
Rodrigo Posted July 21 Share Posted July 21 Hi @c0c0t3 and welcome to the GreenSock forums! You have two issues. First in your CSS you have these: .vertical-sections--wrapper-wrapper { z-index: 2; height: 400vh; } .vertical-sections--wrapper-wrapper.for2 { height: 200vh; } .vertical-sections--wrapper-wrapper.for3 { height: 300vh; } .vertical-sections--wrapper-wrapper { z-index: 2; height: 300vh; } Those create the separation between the elements because of the height of that container nothing more. You can completely remove GSAP, ScrollTrigger and ScrollSmoother and the result is the same. Then you have your start and end points: start: "top 0%", end: "bottom 100%", That basically means that the ScrollTrigger instance will start when the top of the element reaches the top of the viewport and will end when the bottom of the element reaches the bottom of the viewport. Naturally that element tends to be 100vh which means that the start and end point happen at the same time. Here is a fork of your codpen: See the Pen poQZyqb by GreenSock (@GreenSock) on CodePen Hopefully this helps. Happy Tweening! Link to comment Share on other sites More sharing options...
c0c0t3 Posted August 2 Author Share Posted August 2 Thank you it helped me a lot ! 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