cotton Posted August 19, 2022 Share Posted August 19, 2022 Hello I'm trying to change the background colour of an element (site_wrapper) based on the data-attr of another element (section) that is scrolling. I've got it all working but would like to have the scrub affect the colour change rather than just animating the change onEnter. Any pointers would be much appreciated. See the Pen KKoJVaL by Cottonltd (@Cottonltd) on CodePen Link to comment Share on other sites More sharing options...
Solution SteveS Posted August 19, 2022 Solution Share Posted August 19, 2022 @cotton You will want to do it similar to this: See the Pen KKoJMpZ by StevenStavrakis (@StevenStavrakis) on CodePen However, you probably need to adjust the start and end values to get deeper colors / colors at the right time. 2 Link to comment Share on other sites More sharing options...
cotton Posted August 19, 2022 Author Share Posted August 19, 2022 Great Thank you @SteveS. Nice a simple to implement too. 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