Jump to content
Search Community

Tween, ease in & ease out

Leeroy J 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 there,

What I want to do is have a tween that moves 250px right, has a Power3.easeIn and a Back.easeOut.

I can animate the Power3.easeIn fine but how to do get the Back.easeOut. at the end of this movement??
 

 

Power3.easeIn line of code:

TweenMax.to( $( '.mybox' ), 2, { right: 250, ease:Power3.easeIn}, 2);

Im sure its not too hard but I cant seem to work it out.
Thanks in advance.

 

 

Link to comment
Share on other sites

Just to add my two cents.. I would stick to animating only x and y. Animating left or right position offsets will give you poor performance since position offsets like top, left, bottom and right can only animate on a pixel level and can't take advantage of animating on sub-pixel level on a new layer rendering with the GPU for a much smoother animation. Also animating position offsets will cause layout thrashing since those CSS properties when animated have to constantly calculate layout again before painting and compositing to render.

 

Some helpful resources on this

 

https://css-tricks.com/myth-busting-css-animations-vs-javascript/

 

http://www.paulirish.com/2012/why-moving-elements-with-translate-is-better-than-posabs-topleft/

 

:)

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