superpositif Posted May 6, 2022 Posted May 6, 2022 div.image-bg must scale onscroll but is scaled onload. I don't understand why... Could you help me please ? PS : there is an inverted scroll (with smooth-scrollbar.js) See the Pen vYdNbNP by superpositif (@superpositif) on CodePen.
OSUblake Posted May 6, 2022 Posted May 6, 2022 19 minutes ago, superpositif said: div.image-bg must scale onscroll but is scaled onload. I don't understand why... Could you help me please ? You're scrolling to the end of the page, so it's going to trigger that animation. If you're trying to do everything in reverse, then you will probably have to manually control your animations in callbacks like onEnter, onEnterBack, onLeave, onLeaveBack to with animation methods like play, pause, reverse, restart, etc. You're question sounds pretty similar to this one, except it uses scrub, so it needs to use onUpdate instead of those other callbacks. 2
superpositif Posted May 6, 2022 Author Posted May 6, 2022 OSUblake Thank you very much ! It's very interesting to do everything in reverse. I tried but finally I need the animation to be scroll controlled. So I added scrub:1 (did it right?) The result is not bad, however the image does not remain fixed at the bottom of the screen. What do you think ? See the Pen vYdNbNP by superpositif (@superpositif) on CodePen.
OSUblake Posted May 6, 2022 Posted May 6, 2022 36 minutes ago, superpositif said: The result is not bad, however the image does not remain fixed at the bottom of the screen. Yeah, that's not possible because position: fixed will not work inside an element that is being transform, which is what happens with your scroll content. It's just a CSS thing. https://stackoverflow.com/a/15256339/2760155
superpositif Posted May 6, 2022 Author Posted May 6, 2022 damn... I need to calculate a new position onscroll, you think ?
OSUblake Posted May 6, 2022 Posted May 6, 2022 Yeah, that's what I'm thinking. Kind of like how ScrollTrigger does pinning, but in reverse.
superpositif Posted May 7, 2022 Author Posted May 7, 2022 Hum... I don't know how coding that... I need to code this page. All animations are onscroll If you are interested by this job, contact me.
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