Lichay Posted January 18, 2021 Share Posted January 18, 2021 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 More sharing options...
Solution ZachSaucier Posted January 18, 2021 Solution Share Posted January 18, 2021 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. 3 1 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