Jump to content
GreenSock

onedayitwillmake

Keeping a CSS property after tween complete

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

When tweening a CSS property, once the tween is complete it seems the property is removed.

How can I make the CSS property that was tweened persist?

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

The properties that are tweened are supposed to remain in inline-styles on the element or else the element would revert to its pre-tween state when the tween completes. Is this what you are experiencing?

 

There are situations where developers want the inline styles removed or perhaps just a select group of properties and that is what the clearProps allows for: http://api.greensock.com/js/com/greensock/plugins/CSSPlugin.html

 

From your description it sounds like you are getting behavior that is contrary to what is intended. 

 

Can you please post a very simple example that illustrates properties being removed after a tween completes? Would love to help you out.

 

The best thing to do is create a very simple codepen.io example that we can test and edit.

Simply start here: 

See the Pen KaorG by GreenSock (@GreenSock) on CodePen

Fork the sample and edit/replace the code to replicate the issue.

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.
×