Jump to content
Search Community

CSS Transform extended by gsap.set

themepunch test
Moderator Tag

Recommended Posts

Sorry if this question has beed asked earlier and/or if i oversee some basic thing here. 
If you take a look on the example here: 

 

 

You can see that the transform attribute set by css style of the "object" has been extended by the gsap set function
from translate(-50%, -50%)
to  translate(-50%, -50%) translate(50,0) 
 

Is this the way it should work from now on in gsap3x  or it is a bug  ?      

 

Thanks in advance and cheers  !

 

 

See the Pen RwNzbPN by themepunch (@themepunch) on CodePen

Link to comment
Share on other sites

Hey themepunch. This is the intended behavior because GSAP 3 checks for transform values that match exactly -50% and retain those in any tweens that it has. This is because many people expect them to be retained when set in the CSS. We recommend that you set all transforms with GSAP for elements that you're manipulating with GSAP.

 

If you don't want this behavior, just reset xPercent and yPercent (xPercent: 0, yPercent: 0,). 

  • Like 2
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.
×
×
  • Create New...