Share Posted March 11, 2022 Hello! I have this prototype I am working on that I forked from another forum post and tweaked a bit. What I can't seem to figure out is how to make it so the background color animates to a new one for each section. I have a "data-color" attribute on each ".Demo-section" so ideally it would use that value for each section. Basically I'd like it to start with #fff. Animate from #fff to #ddd when second Demo-section comes in Animate from #ddd to #999 when third Demo-section comes in Any help/guidance would be very much appreciated. 🙏 See the Pen 89de500680b3386bbf9c184b627616a7 by itsMeAra (@itsMeAra) on CodePen Link to comment Share on other sites More sharing options...
Solution Solution Share Posted March 11, 2022 Hi @AraAbc Welcome to the forum. If I understand your goal correctly, I think it's just a matter of animating the background-color of the parent #Demo section. Something like this. See the Pen RwxbvjN by PointC (@PointC) on CodePen Hopefully that helps. Just FYI - it's better to make your pens public when you post here so they can easily be forked with changes. Happy tweening and welcome aboard. 3 Link to comment Share on other sites More sharing options...
Author Share Posted March 11, 2022 @PointC omg thank you! Exactly what I wanted. Also can't believe that didn't even cross my mind lol 🤦♂️ it's been a long week 😂 Will make sure my pens are public next time, sorry about that! Thank you so much! 1 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