Jump to content
Search Community

resize screen size change all Gsap end: '+=600' size

Lichay test
Moderator Tag

Go to solution Solved by ZachSaucier,

Recommended Posts

When I change my screen size the element change his position for no reason

if I create height of 600px it should inner element absolute to this height like 500px it should be inside and container

because the container height 600px.

 

moreover when I resize screen viewport to big it work well and when i change it to small it do problems what the reason the px still 600px and screen size not optional.

 

Why it happened and how to fix it?

See the Pen RwGvQbJ by lichaytiram (@lichaytiram) on CodePen

Link to comment
Share on other sites

  • Solution

This has nothing to do with ScrollTrigger. You're positioning your inner div 500px from the top of the container. So if the viewport height is not at least 500px + height of the content, it will not fit in its container since the container has a height of 100vh. ScrollTrigger does not change elements heights when you pin it. It just keeps it in the same position.

  • Like 3
  • Thanks 1
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...