TELLO Posted July 11, 2020 Share Posted July 11, 2020 Hi all, if I move a div with ScrollTrigger faster up. There will be space to the following div. Is there a way - like the pinSpacing: false - to get this space closed? Or must I create a container and move them too to fix this space? Thanks TELLO See the Pen JjYPQpN by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
ZachSaucier Posted July 11, 2020 Share Posted July 11, 2020 Hey TELLO. Sorry, I don't understand what you're saying or how it relates to the demo that you linked. Can you please try to more clearly show the situation that you're asking about? Link to comment Share on other sites More sharing options...
TELLO Posted July 11, 2020 Author Share Posted July 11, 2020 Hi ZachSaucier, if I have 2 div and I move the top faster up to the top of viewport. gsap.to(first-div, { yPercent: -20, ease: "none", scrollTrigger: { trigger: first-div, toggleActions: "restart pause reverse pause", start: "center center", scrub: true } }) Result = the next div will move normal speed of the site. There will go a cap bigger and bigger to the second div. Is there a way to fix this in the script? Like when you pin, you get cap too and you can use the pinSpacing: false. Just asking if there is some magic code for this case too? Link to comment Share on other sites More sharing options...
ZachSaucier Posted July 11, 2020 Share Posted July 11, 2020 I'm still not sure if I'm understanding you correctly. But the code you provided above doesn't add any space, it just moves an element around. The only "space" is what the element takes up in the document's flow. Perhaps you want to absolutely position the elements so that they don't take up any space in the flow? Link to comment Share on other sites More sharing options...
TELLO Posted July 11, 2020 Author Share Posted July 11, 2020 (edited) I move just a relative element. So the way it moves faster, it creates a space. Guess i must make it absolute as a bigger picture and overflow hide in a relative container. Edited July 11, 2020 by TELLO Better way to make it run Link to comment Share on other sites More sharing options...
ZachSaucier Posted July 11, 2020 Share Posted July 11, 2020 If you make a clear demo of what you're trying to accomplish we're happy to help out. Link to comment Share on other sites More sharing options...
TELLO Posted July 11, 2020 Author Share Posted July 11, 2020 @ZachSaucier Sorry for the misunderstanding. I changed the parallax div to a frame position: relativ, overflow: hidden and inside a bigger one absolute, what I move now. So it works without any spacing. I guess it was only my primitiv way to start doing it 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