Jump to content
Search Community

GSAP 3: Noob Question...

SpaceMoney-01011000 test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

I've been looking at some referral code, but it's written in an older version of GSAP (see provided pen).

I understand what I'm looking at, but am not sure how I would go about converting what I'm looking at into something written with GSAP 3 syntax.

 

I was wondering if someone would be willing to explain, or provide a quick snippet, of what the following would look like written using GSAP 3;
 

btn1.click(function()//front face
{
    if(cubeParent[0]._gsTransform.rotationX != 0)
    {
        TweenMax.to(cubeParent, 1, {rotationX:'0_short'});
        TweenMax.to(cubeParent, 1, {rotationY:'0_short'});
        TweenMax.to(cubeParent, 1, {rotation:'0_short'});
    }
    else
    {
        TweenMax.to(cubeParent, 1, {rotationY:'0_short'});
        TweenMax.to(cubeParent, 1, {rotation:'0_short'});
    }
});

I'm not concerned with the function portion of the code. I understand what's going on there. What confuses me is how to use the gsap.getProperty() in place of the _gsTransform() in this specific use-case scenario. 

As far as the TweenMax.to() is concerned, I'm good to go in that area - so there's no need need for further explanation. 

I've already looked at the docs here, but I don't understand how the two correlate in this particular context.


Kind regards,

X

See the Pen nRxjbm?editors=0010 by rhernando (@rhernando) on CodePen

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