Jump to content
GreenSock

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

Follow my mouse ...

Recommended Posts

Hey,

 

OSCAR should be transferred to the new world of GSAP 3.0.
So far so good. But OSCAR does not change the side if HE is in the corresponding area of the window.
What am I not doing the way it should be?

 

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

 

Kind regards

Mikel

 

The gsap 2 version

 

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

Share this post


Link to post
Share on other sites

I assume it's because you've got a quickSetter() that's setting the "x" and "y" directly, and then you're ALSO creating a tween in a "mousemove" that's trying to make x/y go to other values instead. x and y can only be one value at a time :)

 

Maybe you should create a wrapper and then just tween the inner element to control the relative position (side flipping), and the container for the overall position. 

  • Like 2

Share this post


Link to post
Share on other sites

Hey Jack,

 

Thanks for the tip. It's easy to do.

 

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

 

Have a nice weekend.

Mikel

 

  • Like 1

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.

×