maxvia Posted December 1, 2020 Share Posted December 1, 2020 Hi guys, Is there any simple way to change the background color of a div from top to bottom and vice versa? Thanks! p.s: I was trying to add a small video of it but was limited to a file of 25.8kb? Link to comment Share on other sites More sharing options...
ZachSaucier Posted December 1, 2020 Share Posted December 1, 2020 Hey maxvia. This is a browser-level restriction: you can't animate a background-color from any direction in any browser with any tool. With that being said, you can fake it by making an element within the element look like the background and then animating that element. Exactly how you should set it up and animate it depends on the exact effect that you're going for. Here's a super simple example: See the Pen qBadQYo by GreenSock (@GreenSock) on CodePen 4 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