martis Posted April 15, 2021 Posted April 15, 2021 Hello, I am looking to have an animation only scrub in one direction. I am running into an issue with loading and having its start and end points jump around. Or it will appear higher on the page, then as images above it load, it pushes it down, but will not reset correctly using the example here: Is there a method I should be looking at like `refresh()`? See the Pen abZjjNr by GreenSock (@GreenSock) on CodePen.
GreenSock Posted April 16, 2021 Posted April 16, 2021 Were you saying that the demo you linked to had that problem or did you just mean you're trying to do something like that? If you're lazy-loading images that shift the layout around, there are two solutions: Define width/height properties on all your elements/images so that the browser can lay out the page properly right away instead of updating things when they load. If you can't do that, you can just call ScrollTrigger.refresh() AFTER your things are done loading and the layout isn't going to shift around anymore. Let us know if you need anything else. Happy tweening/scrolling!
martis Posted April 20, 2021 Author Posted April 20, 2021 Thanks Jack, I ended up having to abandon it and did something else. Have you guys considered adding some sort of reverse:false option to automatically do this?
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