garyw Posted November 25, 2019 Share Posted November 25, 2019 I don't see clearProps listed in the v3 documentation. Does it still exist? Link to comment Share on other sites More sharing options...
ZachSaucier Posted November 25, 2019 Share Posted November 25, 2019 Hey Gary, Just now, garyw said: I don't see clearProps listed in the v3 documentation. Does it still exist? Yep, it's still there. It's under the CSSPlugin: https://greensock.com/docs/v3/GSAP/CorePlugins/CSSPlugin#h3-clearprops Are you having troubles with it in a project? We're happy to help if you give us a minimal demo. Link to comment Share on other sites More sharing options...
garyw Posted November 25, 2019 Author Share Posted November 25, 2019 No problem. I was just confirming that I can continue to use it. Thanks! Link to comment Share on other sites More sharing options...
Kokku Posted December 1, 2022 Share Posted December 1, 2022 Just a quick note that might help someone: make sure you use true (boolean) and not "true" (string) - was scratching my head for a good while because of this (or just use "all" ) 1 Link to comment Share on other sites More sharing options...
Rodrigo Posted December 1, 2022 Share Posted December 1, 2022 Hi, To complement @Kokku's advice here is the information you can find in the CSS Plugin's DOCS: clearPropsYou may enter a comma-delimited list of property names into clearProps that you want to clear from the element’s style property when the tween completes (or use "all" or true to clear all properties). This can be useful if, for example, you have a class (or some other selector) that should apply certain styles to an element when the tween is over that would otherwise get overridden by the element.style-specific data that was applied during the tween. Typically you do not need to include vendor prefixes. clearProps also clears the "transform" attribute of SVG elements that have been affected by GSAP because GSAP always applies transforms (like x, y, rotation, scale, etc.) via the transform attribute to avoid browser bugs/quirks. Clearing any transform-related property (like x, y, scale, rotation, etc.) will clear the entire transform because those are all merged into one "transform" CSS property. Here you can read more about the CSS Plugin as well: https://greensock.com/docs/v3/GSAP/CorePlugins/CSSPlugin Happy Tweening! 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