Jump to content
Search Community

Tween Object Properties with units

creativetech test
Moderator Tag

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

Hi Creative Tech,

 

You can use units for left, but a you need to define it's position first, i.e. relative, absolute.

You were also trying to tween your object left, which isn't an element, so that's why nothing was changing.

 

See the Pen gbKvGa by osublake (@osublake) on CodePen

 

Or were you trying to tween the numbers? In that case you can always append the units.

 

See the Pen MYXQrr by osublake (@osublake) on CodePen

  • Like 1
Link to comment
Share on other sites

Hi OSU Blake,

 

Thanks for the quick response. I don't want to animate/tween the actual DOM element. I simply wanted to tween a value that contains units. Your second link is more what I was aiming for, however, I dont want to have to append the unit. There is no other workaround?

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