NubieHere Posted January 31, 2020 Share Posted January 31, 2020 Hi, I see that gsap overrides the already applied styles set on the element through markup ( '<div style="yadda yadda"' ... gets overridden ) ... how do I avoid that, and simply have gsap add the properties it needs to work? I set a background-image on the element using the style attribute ... and when doing a gsap.to() ... it removes the background-image element from the style ... that's NOT what I would expect. Link to comment Share on other sites More sharing options...
NubieHere Posted January 31, 2020 Author Share Posted January 31, 2020 OK, wild guessing here made me find the answer ... I had a backgroud-image set directly with an url. BUT I left out the url() wrapper on the string ... and then I guess gsap somehow renders it invalid (or whatever) and removes it. Que? Link to comment Share on other sites More sharing options...
ZachSaucier Posted January 31, 2020 Share Posted January 31, 2020 Hey Nubie, GSAP only affects properties that it needs to change. Maybe you were trying to animate the background property whereas you should be animating the backgroundColor instead? Without seeing a demo or at least your code it's impossible for us to say what's causing this exactly. 1 Link to comment Share on other sites More sharing options...
NubieHere Posted January 31, 2020 Author Share Posted January 31, 2020 Unfortunately not. It was the simple fact that I hadn’t wrapped the string for the background-image property in url() ... the code was part of a way to complex example to simply pull out. I’ll see if I can find the time to recreate a snippet just to see if that’s redoable. Thanks. 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