Share Posted May 12 hi, please help me. I can't figure out, how to calculate the minimum height of an image with data-speed 0.9. The image is in a container with a size of 500px and should never be cropped. If I increase the height of the image by 10% to 110% then the image still crops on larger screens. The screen height is also relevant. Can anybody help? thank you, bye Link to comment Share on other sites More sharing options...
Solution Solution Share Posted May 12 I don't follow what you're asking. Are you talking about a parallax effect. If so, you want the child larger than the container and set the speed to auto. From the docs: "auto" speed When you set the speed to "auto", it will calculate how far it can move inside its parent container in the direction of the largest gap (up or down). So it's perfect for parallax effects - just make the child larger than its parent, align it where you want it (typically its top edge at the top of the container, or the bottom edge at the bottom of the container) and let ScrollSmoother do its magic. Obviously set overflow: hidden on the parent so it clips the child. If that's not what you meant, could you please provide a minimal demo? Thanks and happy tweening. 2 Link to comment Share on other sites More sharing options...
Author Share Posted May 12 thank you!! speed auto works perfect for me. sorry for the stupid question 🙈 I misunderstood the docs... 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