Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Gabriel

Animating 'left' or 'right' should unset the other

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

Besides convenience, it should be implied that if you have an element positioned 'left', and you desire to animate it's 'right' property, that 'left' should be unset. It doesn't make sense to animate a property that would yield no effect, and that you'd need to manually unset the conflicting property. Same with 'top' and 'bottom'.

Link to comment
Share on other sites

Actually, in HTML both pairs of properties can definitely be used together for positioning - there is no implication that using left means you don't want to use right.

 

Check this out:

See the Pen oyKLB by jamiejefferson (@jamiejefferson) on CodePen

 

If your particular design doesn't work with both left and right set, then you will need to manually unset the conflict.

 

You can very quickly clear the conflict with

TweenMax.set(target, { left:"" });

though, and it can also be attached to timelines.

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