Jump to content
Search Community

Easing without Move Back

dizain test
Moderator Tag

Go to solution Solved by Carl,

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

  • Solution

Thanks for the demo.

It would really help if you could explain how we should interact with it and what the desired result is.

 

I added some logs to your conditions and it seems that due to the way the logic and conditional statements are set up that multiple statements are true which then creates competing tweens at the same time.

 

if ( StopX < window.innerWidth  / 2  ) {
  console.log("conditionA")
    TweenLite.to(this.target, 1, {x: 0,y: 0})
} else {
console.log("conditionB")
TweenLite.to(this.target, 2, {x: 100 + "%" })
}


if ( StopX > -window.innerWidth  / 2  ) {
console.log("conditionC")
    TweenLite.to(this.target, 1, {x: 0,y: 0})
} else {
console.log("conditionD")
TweenLite.to(this.target, 1, {x: -100 + "%" })
          

Open the console to see that multiple logs happen when you drag the green box and release: https://jsfiddle.net/4nm5qjmr/

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