Jump to content
Search Community

GSAP 3.0.x wrong left/top value

KIDS interactive test
Moderator Tag

Recommended Posts

Hey guys!
I have one case where the left and top value are setted false in my project. I tried to reproduce it in codepen but i couldn't.

 

gsap.set(rotateScaleHandle, {
   top: '50%',
   left: '50%'
});

This code set's the top and left value to 0%

Values without units or with 'px' are setted correctly.

Is there a case where gsap resets the percentage-values to zero ?

PS: I'll give it a try on codepen again

Link to comment
Share on other sites

Hey KIDS interactive and welcome to the GreenSock forums! Thanks for being a Club GreenSock member. We couldn't do what we do without people like you.

 

3 hours ago, KIDS interactive said:

Is there a case where gsap resets the percentage-values to zero ?

The only case where it should do that is if the unit on which the percentage is based is also 0. If there's a bug with GSAP we want to know and get it fixed. However it's hard to tell from this much information if there actually is a bug or not.

 

Can you provide a non-CodePen demo for us to take a look at that reproduces the issue? The more minimal the better. 

Link to comment
Share on other sites

Good catch! Yes, this had to do with a rare case related to unit conversion when it starts at 0 (it had nothing to do with position: absolute - it just looked that way in your demo because that's what caused things to collapse to 0). it should be resolved in the next release which you can preview at https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/gsap-latest-beta.min.js

  • Like 3
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...