Jump to content
GreenSock

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

Right and left

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×