Jump to content
Search Community

Loop animation while dragging

Key test
Moderator Tag

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,

 

I'm trying to loop a "shake" animation of my drop-area as long as my droppable item is dragged. 

The animation should start 2sec after an item is dragged and should be repeated every 2 seconds.

 

I found a few pens/topics but none of them could make it works.

 

As you can see, I tried using onPress/Release, but it's still not working, and I have a shake animation after page loaded, which I don't want.

 

Is there a way to do that ?

 

Quentin

See the Pen pYJKqg?editors=1010 by anon (@anon) on CodePen

Link to comment
Share on other sites

Welcome to the forum.

 

You'll need to use TweenMax if you want to use the repeat() and repeatDelay() methods. From the docs:

TweenMax extends TweenLite, adding many useful (but non-essential) features like repeat(), repeatDelay(), yoyo(), and more.

https://greensock.com/docs/TweenMax

 

Here's a fork of your pen.

See the Pen moJGEE by PointC (@PointC) on CodePen

Hopefully that helps. Happy tweening.

:)

 

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