Jump to content
Search Community

A problem in easing

Vahid-Designer test
Moderator Tag

Go to solution Solved by Diaco,

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

Hello all. I have a container as below:

 

.section-fixed{
position:fixed;
width:0px;
height:0px;
top:-280px;
right:-280px;
overflow:hidden;
-webkit-border-radius:50%;
-moz-border-radius:50%;
border-radius:50%;
background:transparent;
opacity:0;
z-index:10;
}

which there is a few items within it:

.item-f{
text-decoration:none;
top:calc(50% - 15px);
left:calc(50% - 15px);
position:absolute;
border-radius:50%;
width:30px;
height:30px;
text-align:center;
color:black;
font-size:25px;
cursor:pointer;
}
<section class="section-fixed">
<div class="main-menu-f">
<div id="HomeButton" class="item-f">A</div>

I wrote a code with TweenLite as below:

if(//some condition){
TweenLite.to('.item-f:nth-child(1)', 0.6, {x:0.98 * -220.56290407832017,y:0.98 * 30.932307155207802,rotation:360,autoAlpha:1,ease:Back.easeOut.config(1.87)});
else{
TweenLite.to(".item-f:nth-child(1)", 0.6, {x:0,y:0,rotation:-360,autoAlpha:0,ease:Back.easeIn});
}

The problem is for when if condition is true, unfortunately ease function doesn't work correctly and the element moves in its way, simply. But when the else condition is true, Back.easeIn done correctly. What's going on? Can everybody help me at this?

 

 

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