Jump to content
Search Community

scrollSmoother overflow issue

Jamesh test
Moderator Tag

Go to solution Solved by Jamesh,

Recommended Posts

Ive been trying for a couple of days to get this to work! 

 

Essentially I have smoothscroller working with some simple parallax effects when scrolling through the page. The issue I'm having is that if the text on the opposite site of the image is longer that the image is creates a blank at the bottom of the image (you may need to resize your viewport). Please see last section of the codepen attached. I guess this makes sense as the CSS is specifically setting the height to 100vh but does anyone know of a solution whereby the image always fills its container to mirror the height of its sibling element?

 

I thought a workaround would be to find the height of the text element and then set the image-cont-height to mirror the height and then use calc in js to add additional pixels to create the parallax effect. 

See the Pen MWQopKw by jame5 (@jame5) on CodePen

Link to comment
Share on other sites

I think that's mostly a CSS issue. Here's a version that seems to work:

See the Pen OJQqPam?editors=0010 by GreenSock (@GreenSock) on CodePen

 

However, there does appear to be some oddness with the data-speed="auto" when you have things aligned on the bottom of the container. I'm looking into that, but for now you may need to set a certain speed rather than auto in this case. And you can set the height via JS to make it 125% of its container.

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...