Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Gary

Weird behavior with gradients and the body tag

Recommended Posts

While attempting to set a gradient on the body tag I noticed some weird behavior. If I set a background radial gradient on a div, it works.  If I set it on the body, it doesn't.  If I set it on both, in an array, it works for both or neither depending on the order within the array.

 

In the codepen, uncomment each of the TweenMax.set() lines in turn, one at a time.

See the Pen e9763e2c61be0bcfb3e0956b3e5d206d?editors=011 by garyc (@garyc) on CodePen

Link to comment
Share on other sites

Hi Gary,

 

Thanks for the concise, yet thorough, demo.

 

Please try using backgroundImage instead of background.

TweenMax.set(theBody, {backgroundImage: gradient});
  • Like 2
Link to comment
Share on other sites

Works great so far. Thanks, Carl !!!

 

I'll be putting a much more elaborate demo on codepen shortly.  :)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×