Jump to content
GreenSock

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

Right and left

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 have a little problem with right and left. When I click on the button 'inscription' everything is ok. But, when I click  on 'logIn' it doesn't work. Indeed, Left still has '0' and right has also '0'. Then, nothing happens. I've tried with t1.fromTo(.img, 0.35, {left : 0}, {right:0}), but it doesn't work. 

Can you help me to understand why 'left 'still has 0 when I click on 'logIn'  ?

Thanks :). 

inscription.addEventListener('click', () =>{
    t1.to(img, 0.35, {borderBottomLeftRadius:'200px 400px',borderBottomRightRadius:'0px', borderTopRightRadius:'0px',borderTopLeftRadius:'200px 400px', left: 0, strictUnits:true});
    t1.to(form, 0.35, {right:'8%', zIndex:1, strictUnits:true}, '-=0.35');
    t1.to(form,0.35, {opacity: 1}, '-=0.20');
});

logIn.addEventListener('click', () => {
    t1.to(img, 0.35, {borderBottomLeftRadius:'0px',borderBottomRightRadius:'200px 400px', borderTopRightRadius:'200px 400px',borderTopLeftRadius:'0px', right: 0, strictUnits:true});
    t1.to(form,0.35, {opacity: 0}, '-=0.20');
});

 

See the Pen RwbmXZW by tedtech7 (@tedtech7) on CodePen

Share this post


Link to post
Share on other sites

Hey @TedTech,

 

Welcome to the GreenSock Forum.

 

Without seeing the case live, it is difficult to give advice.
So please provide a CodePen with your (reduced) case.

 

Here's an example ...

 

See the Pen aboreNR by mikeK (@mikeK) on CodePen

 

Happy tweening ...

Mikel

Share this post


Link to post
Share on other sites

Hey @TedTech,

 

Here a simple concept to toggle such an animation:

 

See the Pen ExYBYJN by mikeK (@mikeK) on CodePen

 

Happy toggling ...

Mikel

 

  • Like 4

Share this post


Link to post
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

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. 


  • Recently Browsing   0 members

    No registered users viewing this page.

×