Jump to content
Search Community

ScrollTrigger Parralax remove the Space?

TELLO test
Moderator Tag

Recommended Posts

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

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

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 by TELLO
Better way to make it run
Link to comment
Share on other sites

@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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...