Jump to content
GreenSock

sixclones

TweenLite doesn't take original value

Go to solution Solved by Carl,

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,

 

I wanted to move the height of a div with tweenlite...

TweenLite.to('div', 10, {bottom: '85%'});

But, it's not work. The value jump to 0 and doesn't take the original value of 80%.

The element is not define with height but with position: absolute.

position: absolute;
  top: 10%;
  bottom: 80%;
  left: 50%;
  right: 40%;

I wanted to signal this and know if it's "normal" or if it's just me.

 

My Codepen test :

 

Thank for answer :)

 

Sixclones

See the Pen PzdmoB by Sixclones (@Sixclones) on CodePen

Link to comment
Share on other sites

  • Solution

Hi and welcome to the GreenSock forums,

 

Thanks for the demo.

 

Not sure I understand the problem. If you look in dev tools and inspect the element you will see the inline styles are updating properly: http://prntscr.com/c0o3ub.

 

Change the end value with a longer duration to make it more obvious that it works: http://codepen.io/GreenSock/pen/bZxRRZ

  • Like 3
Link to comment
Share on other sites

This is science-fiction.

When i post the Codepen, it doesn't work, and now it works perfectly.
Maybe due to Chrome's update.

Sorry for the useless topic.
And thanks for the quick answer.

  • Like 1
Link to comment
Share on other sites

Thanks for letting us know. I think every JS developer has lost many hours to mysterious happenings;)

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